Playing buffer, windows phone 8 -



Playing buffer, windows phone 8 -

i seek play sound buffer in windows phone app.

byte[] buffer = new byte[44100 * 2 * 5]; float t = 0; (int = 0; < 44100 * 2 * 5; += 2) { short val = (short)(math.sin(t * 2 * math.pi * 440) * short.maxvalue); buffer[i] = (byte)(val & 0xff); buffer[i + 1] = (byte)(val >> 8); t += 1 / 44100.0f; } sf = new soundeffect(buffer, 44100, audiochannels.mono); // play. sf.play();

i error: first chance exception of type 'system.invalidoperationexception' occurred in microsoft.xna.framework.ni.dll exception of type 'system.invalidoperationexception' occurred in microsoft.xna.framework.ni.dll not handled in user code

help pls!

you need phone call frameworkdispatcher.update.

same reply here should work: playing sound generated buffer in windows phone app

windows-phone-8

Comments

Popular posts from this blog

javascript - THREE.js reposition vertices for RingGeometry -

javascript - I need to update the text of a paragraph by inline edit -

assembly - What is the addressing mode for ld, add, and rjmp instructions? -