• Advertisement
Sign in to follow this  

playing multiple sound formats at the same time

This topic is 1924 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everyone, In the game I'm developping I'm trying to use nsf (nintendo sound format) files as music and waves as sound effects. The nsf library uses SDL_Sound. the problem is that I can never load two files simultaneously. The NSF library is not able to load two sounds at once, and when I try to load my wav files with SDL_Mixer, I can't play the NSF file.

I was wondering if multi threading would solve this...

Share this post


Link to post
Share on other sites
Advertisement
Erm, Never having played with SDL, but ...

Can you not just preload your sound effects? Then just stream the music (if you even need to stream it, maybe you can preload this too, depending on the platform?).

If you preload them you can decompress them ahead of time from e.g. ogg, into raw data, then play them without having to run the decompression on the fly.

Share this post


Link to post
Share on other sites
Just convert them to wav. Record them playing with Audacity and export them to wav. Problem solved. Assuming you are developing for the PC, Why use NSF to begin with?

Did you rip sounds from a Nintendo game to use in your game? The real answer in that case is to not commit copyright infringement.

Share this post


Link to post
Share on other sites
lawnjelly: by load I meant preload :/
Daark: the NSF files are my original music. made with famitracker. The reason I want to use NSF's is that sometimes NSF's slow down when changing screens etc... And I love that nostalgic feeling [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img]. But if I cant solve this eventually I'll convert to wav and use them like that...

Share this post


Link to post
Share on other sites
Then convert to wav or another suitable format, and program your own slowdown by altering the playback speed on the fly at specific points.

Share this post


Link to post
Share on other sites
[quote name='Daaark' timestamp='1350068911' post='4989556']
Then convert to wav or another suitable format, and program your own slowdown by altering the playback speed on the fly at specific points.
[/quote]
ahah never thought it like that... thanks I'll try that

Share this post


Link to post
Share on other sites
ok I used wav's with SDL_mixer, but now I have a new problem: seamless looping... I need no glitches between audio files since some songs have to be in different audio files (for example 1 non looped intro than loop the rest).. I did a little research and found out that it is a problem of SDL_Mixer. Does anyone know other sound libraries that can solve this issue? Edited by tashaklikedi

Share this post


Link to post
Share on other sites
You should check out OpenAL. It's got an open licence, but it will take a bit of work to set up (SDL takes care of a lot for you).
[url="http://connect.creativelabs.com/openal/default.aspx"]http://connect.creativelabs.com/openal/default.aspx[/url]

On a side note, I used SDL for a while and found SFML. It's a modern, OpenGL, open-sourced library that has pretty much everything SDL has. Portability is not quite as extensive (you won't be running SFML on a portable device or console), but it's definitely worth checking out. SFML has a MUCH more feature rich sound system. When I switched to SFML I never looked back to SDL.
Also, I'm new to these forums, so I'm sorry if "advertising" is against the rules, haha. :)

Share this post


Link to post
Share on other sites
[quote name='Ruckamongus' timestamp='1350091742' post='4989641']
You should check out OpenAL. It's got an open licence, but it will take a bit of work to set up (SDL takes care of a lot for you).
[url="http://connect.creativelabs.com/openal/default.aspx"]http://connect.creat...al/default.aspx[/url]

On a side note, I used SDL for a while and found SFML. It's a modern, OpenGL, open-sourced library that has pretty much everything SDL has. Portability is not quite as extensive (you won't be running SFML on a portable device or console), but it's definitely worth checking out. SFML has a MUCH more feature rich sound system. When I switched to SFML I never looked back to SDL.
Also, I'm new to these forums, so I'm sorry if "advertising" is against the rules, haha. [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]
[/quote]

I know about SFML, I never tried it but I know that it has more features than SDL ( like sprite rotating). As for the sound I went for FMOD and it worked well ^^.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement