0
0

Hello

I’d like to create an MP3 file out of several WAV files dynamicaly with vb.net. Is it possible to do this with the FMOD-API? If so, how would you suggest to do this? I don’t need a complete manual but it would be nice if somebody could give me some hints.

This is how I think it could work:

[list:22xfr1ji]
[:22xfr1ji]Create a new sound stream[/:m:22xfr1ji]
[:22xfr1ji]Load first WAV into memory[/:m:22xfr1ji]
[:22xfr1ji]Copy sound data from WAV to sound stream[/:m:22xfr1ji]
[:22xfr1ji]Load second WAV into memory[/:m:22xfr1ji]
[:22xfr1ji]Copy sound data from WAV to sound stream[/:m:22xfr1ji]
[:22xfr1ji]….[/:m:22xfr1ji]
[:22xfr1ji]Save sound stream as MP3[/:m:22xfr1ji][/list:u:22xfr1ji]

This process must [b:22xfr1ji]NOT [/b:22xfr1ji] take real time. That means, if the WAV files have a total length of 4 Minutes it must [b:22xfr1ji]NOT[/b:22xfr1ji] take 4 Minutes to create the MP3 but much shorter. [/list]

Kind Regards
Raffael Walther

  • You must to post comments
0
0

That’s overly-complicated. Here’s what I’d reccomend:
– Call System::setOutput() with FMOD_OUTPUTTYPE_NOSOUND_NRT
– Call System::init() with the FMOD_INIT_STREAM_FROM_UPDATE flag
– Create streams for all of your wave files, then play them all
– Write a DSP unit that saves off the input as an MP3 file, and attach it to the System Master ChannelGroup
– Then you’ll have code something like this:
[code:dh3yftdx]while(IsAnyChannelPlaying())
{
pSystem->update();
}[/code:dh3yftdx]
Hope that helps!

  • Guy
  • You must to post comments
0
0

Hello Guy

Many thanks for you answer it already helps a lot. What I don’t understand yet is how do I create a DSP that saves my input as an MP3? Is it really as complicate as it sounds like in your post? The strange thing is that i can’t find anything about how to save sound to a file in the FMOD EX manual at all.

Regards
Raffael[/list][/list]

  • You must to post comments
0
0

Well, FMOD is a playback engine, and not really designed for writing files out to disk. It provides you with facilities to do so, but focuses on output to the soundcard, and leaves the specifics of writing files out to you.

So, there are two things I’d suggest you have a look at:
1.) Look in the FMOD install directoy, under examples\plugin_dev\output_mp3 there is an example of an mp3 writer. You may be able to use or adapt that.
2.) One even simpler solution would be to use FMOD_OUTPUTTYPE_WAVWRITER_NRT instead of FMOD_OUTPUTTYPE_NOSOUND_NRT. The WAVWRITER one will write the output to a .wav file (set the file to output with the ‘extradriverdata’ in System::init() to give it a filename). You can then use any off-the-shelf program (CDex does this well: [url:2hk7ow9w]http://sourceforge.net/projects/cdexos/[/url:2hk7ow9w]) to convert it to mp3, Ogg Vorbis, or whatever other format you want.

  • Guy
  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.