We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cab9211 commit 8811b15Copy full SHA for 8811b15
1 file changed
examples/play_file.py
@@ -8,10 +8,10 @@
8
import soundfile as sf
9
10
filename = sys.argv[1]
11
-playback_blocksize = 256
12
-latency = 0
13
-reading_blocksize = 1024
14
-rb_size = 16 # Number of blocks, has to be power of two
+playback_blocksize = None
+latency = None
+reading_blocksize = 1024 # (reading_blocksize * rb_size) has to be power of 2
+rb_size = 16 # Number of blocks
15
16
with sf.SoundFile(filename) as f:
17
with rtmixer.Mixer(channels=f.channels,
@@ -38,6 +38,7 @@
38
if written < size:
39
break
40
m.wait(action)
41
- # TODO: check for ringbuffer errors
+ if action.done_frames != f.frames:
42
+ RuntimeError('Something went wrong, not all frames were played')
43
if action.stats.output_underflows:
44
print('output underflows:', action.stats.output_underflows)
0 commit comments