User Tools

Site Tools


outputting_20real-time_20audio

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
outputting_20real-time_20audio [2024/04/19 17:31] – draft richardrusselloutputting_20real-time_20audio [2024/04/19 17:40] (current) – tentative richardrussell
Line 69: Line 69:
           REPEAT           REPEAT
             WAIT 1             WAIT 1
-            SYS `SDL_GetQueuedAudioSize`, @hwo%, @memhdc% TO S%             +            SYS "SDL_GetQueuedAudioSize", @hwo%, @memhdc% TO S%             
-          UNTIL S% < BytesPerBuffer%+          UNTIL S% < 2 * BytesPerBuffer%
         UNTIL FALSE         UNTIL FALSE
 +        END
 </code> </code>
  
Line 84: Line 85:
         LOCAL I%, D         LOCAL I%, D
         PRIVATE P         PRIVATE P
-        D = Frequency / Format.nSamplesPerSec% * 2*PI : REM Phase change per sample+        D = Frequency / audiospec.freq% * 2*PI : REM Phase change per sample
         FOR I% = 0 TO 2*N%-2 STEP 2         FOR I% = 0 TO 2*N%-2 STEP 2
           B%%!I% = 32767*SIN(P)           B%%!I% = 32767*SIN(P)
Line 100: Line 101:
 <code bb4w> <code bb4w>
       DEF PROCcleanup       DEF PROCcleanup
-      Device% += 0 +      IF @hwo% THEN 
-      IF Device% THEN +        SYS "SDL_PauseAudioDevice", @hwo%, 1, @memhdc% 
-        SYS "SDL_PauseAudioDevice", Device%, 1, @memhdc% +        SYS "SDL_CloseAudioDevice", @hwo%, @memhdc%
-        SYS "SDL_CloseAudioDevice", Device%, @memhdc% +
-        Device% = 0+
       ENDIF       ENDIF
       ENDPROC       ENDPROC
outputting_20real-time_20audio.txt · Last modified: 2024/04/19 17:40 by richardrussell