Jump to content

  • Log In with Google      Sign In   
  • Create Account

playing multiple sound formats at the same time


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
8 replies to this topic

#1 tashaklikedi   Members   -  Reputation: 218

Like
0Likes
Like

Posted 12 October 2012 - 12:18 PM

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...

Sponsor:

#2 lawnjelly   Members   -  Reputation: 429

Like
0Likes
Like

Posted 12 October 2012 - 12:34 PM

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.

#3 MrDaaark   Members   -  Reputation: 3555

Like
0Likes
Like

Posted 12 October 2012 - 12:36 PM

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.

#4 tashaklikedi   Members   -  Reputation: 218

Like
0Likes
Like

Posted 12 October 2012 - 12:50 PM

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 Posted Image. But if I cant solve this eventually I'll convert to wav and use them like that...

#5 MrDaaark   Members   -  Reputation: 3555

Like
0Likes
Like

Posted 12 October 2012 - 01:08 PM

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

#6 tashaklikedi   Members   -  Reputation: 218

Like
1Likes
Like

Posted 12 October 2012 - 01:13 PM

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

ahah never thought it like that... thanks I'll try that

#7 tashaklikedi   Members   -  Reputation: 218

Like
0Likes
Like

Posted 12 October 2012 - 05:28 PM

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, 12 October 2012 - 05:29 PM.


#8 Ruckamongus   Members   -  Reputation: 102

Like
0Likes
Like

Posted 12 October 2012 - 07:29 PM

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).
http://connect.creativelabs.com/openal/default.aspx

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. :)

#9 tashaklikedi   Members   -  Reputation: 218

Like
0Likes
Like

Posted 13 October 2012 - 01:42 PM

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).
http://connect.creat...al/default.aspx

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. Posted Image


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 ^^.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS