X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=SDL_UnlockAudioDevice.html;h=58633f8034bfb9c9bc79e04f10015afdc22d2162;hb=1b6b777963251c9b644149100832afe89af5ca9a;hp=809cf5c623b7fd32c15f28c2941169aed191a473;hpb=330a262e6543b2a70df3bae6595db44b28f360ee;p=sdl2referencejp%2Fsdl2referencejp.git diff --git a/SDL_UnlockAudioDevice.html b/SDL_UnlockAudioDevice.html index 809cf5c..58633f8 100644 --- a/SDL_UnlockAudioDevice.html +++ b/SDL_UnlockAudioDevice.html @@ -19,11 +19,34 @@
devƒƒbƒN‚ð‰ðœ‚·‚éƒI[ƒfƒBƒIƒfƒoƒCƒX‚ÌID
+

ƒTƒ“ƒvƒ‹ƒR[ƒh

+

+ +

+void MyAudioCallback(void *userdata, Uint8* stream, int len)
+{
+    printf("ƒI[ƒfƒBƒIƒR[ƒ‹ƒoƒbƒNŠJŽn!\n");
+    SDL_memset(stream, 0, len);  // ‚½‚¾’¾–Ù‚Ì‚Ý
+    printf("ƒI[ƒfƒBƒIƒR[ƒ‹ƒoƒbƒNI—¹!\n");
+}
+
+// ŽÀÛ‚ɂ͈ê“x‚É2•b‚àŽ~‚ß‚È‚¢‚悤‚É‚·‚邱‚Æ
+extern SDL_AudioDeviceID devid;
+SDL_Delay(2000);  // ƒR[ƒ‹ƒoƒbƒN‚Í2•bŠÔ“®ì‚·‚é
+SDL_LockAudioDevice(devid);
+printf("¡‚©‚çƒI[ƒeƒBƒIƒR[ƒ‹ƒoƒbƒN‚Í“®ì‚µ‚È‚¢!\n");
+SDL_Delay(2000);  // ƒR[ƒ‹ƒoƒbƒN‚Í2•bŠÔ“®ì‚µ‚È‚¢
+printf("OK, ƒAƒ“ƒƒbƒN‚µ‚½!\n");
+SDL_UnlockAudioDevice(devid);
+SDL_Delay(2000);  // ƒR[ƒ‹ƒoƒbƒN‚Í2•bŠÔ“®ì‚·‚é
+
+ +

Ú×

SDL_LockAudioDevice()‚̃ƒbƒN‚ð‰ðœ‚·‚é. ‚»‚̊֐”‚̏ڍׂðŽQÆ‚·‚邱‚Æ.

ŠÖ˜A€–Ú(ŠÖ”)

-SDL_LockAudioDevice
+SDL_LockAudioDevice

SDL Wiki‚ւ̃Šƒ“ƒN

SDL_UnlockAudioDevice - SDL Wiki