ChrisV Posted September 12, 2014 Posted September 12, 2014 Hey guys! Was working on some sounds and music for Hostile. Exported some footstep sounds in .ogg format, and tried playing them ingame by modifying the script. Unfortunaly, it's not possible to play those sounds, because .ogg isn't supported in LE? I can easily convert them to .wav, that's no problem. And, for small sound files like footsteps or screams or whatever, wav would be acceptable...but, not really for music. A 3 minute music file in .wav format is around 30 MB. So, if you have like 10 music files in .wav, you'll need a lot of disk space for them. If you then add all the other sounds, and other media (art, textures, models, etc...), you'll end up with a game that uses a lot of disk space. The same 3 minute song is like 10 times smaller in .ogg format, while still keeping a pretty good sound quality. The same for .mp3 format, but from what i've read, .mp3 isn't allowed commercially? Anyways, i think it would be a good idea to have support for .ogg and other formats that can save disk space without loss of quality. 7 Quote My Artwork. ZBrush 4R7 64-bit - 3DCoat 4.5 BETA 12 - Fl Studio 12 64Bit - LE 3.2 Indie version - Truespace 7 - Blender 2.71 - iClone 5.51 Pro - iClone 3DXChange 5.51 pipeline - Kontakt 5 - Bryce 7 - UU3D Pro - Substance Designer/Painter - Shadermap 3 - PaintShop Photo Pro X7 - Hexagon - Audacity - Gimp 2.8 - Vue 2015 - Reaktor 5 - Guitar Rig 5 - Bitmap2Material 3
Roland Posted September 12, 2014 Posted September 12, 2014 +1 1 Quote Roland Strålberg Website: https://rstralberg.com
gamecreator Posted September 12, 2014 Posted September 12, 2014 .ogg and other formats that can save disk space without loss of quality. Just to be clear, if the OGG containts FLAC, then it's lossless and the size is reduced around 40-50%, per the wiki. Otherwise, it's lossy (and smaller). 1 Quote
BES Posted September 12, 2014 Posted September 12, 2014 I agree there should be support for .ogg in LE3. Quote Threadripper 2920X Gen2 CPU(AMD 12-core 24 thread) | 32Gigs DDR4 RAM | MSI Nvidia GeForce RTX 2070 Stock OCed | ASRock X399 Professional Gaming Motherboard | Triple M.2 500Gig SSD's in Raid0 Windows 10 Pro | Blender | Paint.Net | World Machine | Shader Map 4 | Substance Designer | Substance Painter | Inkscape | Universal Sound FX | ProBuilder | 3D World Studio | Spacescape | OpenSky | CubeMapGen | Ecrett Music | Godot Engine | Krita | Kumoworks | GDScript | Lua | Python | C# | Leadworks Engine | Unity Engine
Josh Posted September 12, 2014 Posted September 12, 2014 Here's some decoding code: // oggdecoder.c #include <stdlib.h> #include <stdio.h> #include <errno.h> #include <string.h> #include <vorbis/vorbisfile.h> static int quiet = 0; static int bits = 16; #if __APPLE__ && __BIG_ENDIAN__ static int endian = 1; #else static int endian = 0; #endif static int raw = 0; static int sign = 1; typedef struct oggio oggio; struct oggio { OggVorbis_File vf; ov_callbacks cb; }; /* void _analysis_output_always(char *base,int i,float *v,int n,int bark,int dB,ogg_int64_t off) { }; */ void *Decode_Ogg(void *stream,void *oread,void *oseek,void *oclose,void *otell,int *samples,int *channels,int *freq) { oggio *ogg; int res; ogg_int64_t samples64; *samples=-1; ogg=(oggio*)malloc(sizeof(oggio)); ogg->cb.read_func=oread; ogg->cb.seek_func=oseek; ogg->cb.close_func=oclose; ogg->cb.tell_func=otell; res=ov_open_callbacks(stream,&ogg->vf,0,0,ogg->cb); if (res<0) {free(ogg);return 0;} samples64=ov_pcm_total(&ogg->vf,0); *samples=(int)samples64; *channels=ov_info(&ogg->vf,-1)->channels; *freq=ov_info(&ogg->vf,-1)->rate; return ogg; } int Read_Ogg(oggio *ogg,char *buf,int bytes) // null buffer to close { int res,bs; if (buf==0) return ov_clear(&ogg->vf); while (bytes>0) { res=ov_read(&ogg->vf,buf,bytes,endian,bits/8,sign,&bs); if (res<0) { if (bs) return -1; // Only one logical bitstream currently supported return -2; // Warning: hole in data } buf+=res; bytes-=res; } return 0; } 4 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
damvcoool Posted September 15, 2014 Posted September 15, 2014 How would i go about doin't it on LUA? 4 Quote
AggrorJorn Posted September 16, 2014 Posted September 16, 2014 I second this. My main project exists out of 3.8 GB of sound and that is just speach and not even music. I think ogg support is something that should be part of the core leadwerks functionality. 8 Quote
insomniac_lemon Posted October 24, 2014 Posted October 24, 2014 I agree. As a free-and-open format it should be supported by default. Every sound I record is stored as OGG. Quote
macklebee Posted October 25, 2014 Posted October 25, 2014 Agree - after having ogg supported in LE2 and to go to wav for LE3 has required me to have to convert almost all sounds from ogg to a filesize twice the original size... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel
Ywa Posted October 27, 2014 Posted October 27, 2014 If you have some C++ knowledge you can add support for the BASS audio library (supports MP3, OGG and more). It's free of charge for non-commercial use. What you need: - http://www.un4seen.com/ (library) - https://github.com/brachyonic/LuaBASS (Lua bind for BASS) - A wrapper to mimic/replace the common Sound Lua functions. I'm working on this, might release it when I'm done and people want it. 1 Quote
gamecreator Posted October 27, 2014 Posted October 27, 2014 I remember loving the simplicity of that library but I also thought it supported password protected ZIP files, which isn't mentioned in the feature list. Dang. Quote
Ywa Posted October 27, 2014 Posted October 27, 2014 Are your sounds that important? I mean.. I can understand you want to protect your Lua code and such, but many commercial games store their sounds in normal files. Or is it due to licensing? -- I just finished my wrapper which overwrites the normal Sound & Source, which works perfectly. I also made some updates to the LuaBASS bind. If anyone wants more info just send me a PM. Quote
gamecreator Posted October 27, 2014 Posted October 27, 2014 All of the above. Many indie games also sell their soundtracks to offset costs and the generally low prices of their games. Quote
Josh Posted October 29, 2014 Posted October 29, 2014 As of 3.3 we have official support for encrypted zip archives that are created automatically in the publish process. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
gamecreator Posted October 29, 2014 Posted October 29, 2014 This is a powerful addition to the engine! However, as ZIP is horrible at compressing WAV, the file size issue will remain. Edit: Just did a quick test at home on a 5 minute song. WAV (16 bit PCM, 2 channels, 44,100 Hz): 50.4MB ZIPped WAV: 44.5MB OGG (7 quality, around 190kbps, 44kHz): 7.28MB From my understanding these are typical results and all projects with music and sound (and how many don't have them eventually?) would benefit from this implementation. 2 Quote
Olby Posted November 15, 2014 Posted November 15, 2014 As a sound designer I completely agree. OGG is a must. It will not only reduce the size of your games but also improve loading times since there's a lot less data to be parsed. Additionally we could use WAV/OGG asset playback straight from the editor. Its very annoying to Alt-Tab between your audio editing package and LE just to audition the sounds you want to use. 5 Quote Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)
DerRidda Posted November 15, 2014 Posted November 15, 2014 One more thing: Most of us here probably have low upload speeds, as soon as you start collaborating with other people or pushing your project backups online we will probably lose a lot of time just because of the wav files. 4 Quote
Bytecroc Posted December 2, 2014 Posted December 2, 2014 .ogg would be great and .x + .b3d with animations for models directly. Quote Leadwerks 4.x Pro, examples please for C++, english is not my native language.
abyssus Posted January 10, 2015 Posted January 10, 2015 Adding support for playing oog sound files would be a valuable improvement to the Leadwerks engine. Quote
YouGroove Posted January 11, 2015 Posted January 11, 2015 I would like to see it supported somewhere this year, perhaps , reducing a lot file sound file size it's as good as texture compression. Specially to publish make tiny demo game concept demos. 1 Quote Stop toying and make games
Olby Posted January 11, 2015 Posted January 11, 2015 Yesterday during the Leadwerks hangout Josh said its not a priority. "who has that much music to benefit from compression" were his words. Unfortunately. [Edit] An average WAV music file can weight around 40 to 60 MB. An equivalent OGG file would be about 5-10 MB depending on quality. The argument that encrypted ZIP files help in this case is not appropriate. ZIP compression is horrible at reducing audio file size and besides the file it self is never reduced it still needs to be decompressed in RAM which can be used for other [more useful] purposes. OGG uses psychoacoustic compression which strips parts of audio that we as humans would never hear anyway. Thus reducing the file bandwidth. I guess for now its up to us to implement some kind of audio compression. Quote Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)
YouGroove Posted January 11, 2015 Posted January 11, 2015 Yesterday during the Leadwerks hangout Josh said its not a priority. If foliage and some other features comes faster, than it's ok to leave Ogg for now. And perhaps someone will write a plugin and Lua binding for all LE3 users ? Quote Stop toying and make games
Olby Posted January 11, 2015 Posted January 11, 2015 If foliage and some other features comes faster, than it's ok to leave Ogg for now. And perhaps someone will write a plugin and Lua binding for all LE3 users ? He promised a slew of new features that we all are waiting for. So OGG can wait indeed, especially if no one is stopping you from writing your own parser. Quote Intel Core i7 Quad 2.3 Ghz, 8GB RAM, GeForce GT 630M 2GB, Windows 10 (x64)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.