Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Mixing Algorithm

This topic is 6996 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

Guest Anonymous Poster
Basically, you just add the two samples (let it loop around):
Why not do it in asm, much faster and easier that c(pp):

mix(pSource1,pSource2,pDest) {
mov esi,pSource1
mov edi,pSource2
mov edx,pDest
mov ax,word ptr [esi]
add ax,word ptr [edi]
mov word ptr [edx],ax
add esi,2
add edi,2
IF(!DONE) jmp nextsample

this is for 16-bit pcm (uncompressed)

Share this post

Link to post
Share on other sites
I need to capture the sound output from my game into a wave file.

I am trying to create my own 16bit sound mixer to implement in my program, so I can dump the output to a file.
Does anyone know where I can get the algorithm/procedure to mix numerous 16bit Stereo 44k samples into one buffer/file?

Or is there a library available?
Basically, I need the source code for the conversion utility MOD2WAV.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!