View Full Version : Sound library comparison specs
code_glitch
15-02-2011, 05:05 PM
Fiddling with some code (again) and I found that some of my advancements in 'technology' mean that in order to play a 1min49sec (1.8MiB) Ogg file, my program will use 20.02mb of memory. I don't know what the standard here is, but would anyone deem that acceptable?
ps: The ogg file is 44.1khz, 128kb/s played back at 22.05khz in 16bit (2 channels).
Just a thought. Please don't take this as a competition/challenge for all you OpenAl dudes/dudettes who will go out and come back with the same result in 250kb ;)
Andru
15-02-2011, 05:30 PM
I don't know what the standard here is, but would anyone deem that acceptable?
No. My library will use only 64Kb(size of buffer) for streaming audio file. And yours seems just decode Ogg file into PCM and play it, this is not a good idea to play the music :)
code_glitch
15-02-2011, 05:35 PM
I thought so. The thought was driving me insane and led me to post this. The dilemma is simple: support as many possible formats. Thus, my solution was sdl_mixer. However, it only has a 'stream' mode as Sdl_Mus which can only play back one file at a time. The only alternative is chunk: which loads it all into RAM. Would there be anyway to have Sdl 'stream' data from disk to chunk for playing?
Or better - could sdl decode the file and then stream it to OpenAl? However, I can never get OpenAl to play more than one file at a time so it sort of defeats the benefit of using chunk in the first place.
cheers,
code_glitch
chronozphere
15-02-2011, 07:06 PM
I don't entirely understand your issue. You want to play multiple music files (ogg/mp3) simultaniously? Why would you want to do that?
I simply want to support OGG (and maybe also MP3) in my code. Being able to play a single music file and multiple WAV soundeffects seem perfectly sufficient for game development. Also, I dont think it's worthwile to support a lot of music formats. Most games dont have an awefull lot of music so it's not a problem to convert all content to the right format. :)
code_glitch
15-02-2011, 08:23 PM
Multiple music files, and multiple audio files at once are two entirely different issues. I apologise if I was unclear earlier - but I meant audio files in general. The reason being that I would like to have support for a simple remixing app along with the ability to stream multiple files at once - since it could be a unique app. Also, the issue I have trouble with is that whatever I try I can never get OpenAl to play two audio files at the same time. Every attempt one cuts out as the other starts. Frustrating.
chronozphere
15-02-2011, 08:50 PM
Hmm... I think playing two audio files in openal is quite easy. OpenAL just works with buffers and sources, with wich you can play things simultaniously. The hardest part is getting the data into the buffers without any hickups i guess (in case of streaming audio). Playing should go perfectly well. :)
Are you able to play 2 wave files simultaniously? Or is your problem time-related (you want to start playing both at exactly the same time)?
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.