Skip to content

Writing audio to disk #456

Closed Answered by josephine-wolf-oberholtzer
dayunbao asked this question in Q&A
Discussion options

You must be logged in to vote

Make sure you pass frame_count=0 in recording_buffer.write(...). Otherwise it defaults to frame_count=-1 which will write all of the (zeroed) samples in the buffer to disk before it gets to writing what your synths have written into it.

It can be really helpful to validate what commands your system is sending by wrapping blocks of code in with server.osc_protocol.capture() as transcript: and then dumping out what OSC commands you actually sent, and compare them against what's in the official Server Command Reference.

def main() -> None:
    server = Server().boot()
    server.add_synthdefs(audio_to_disk, saw)
    server.sync()
    file_path = create_buffer_file_path()
    with server.osc_…

Replies: 6 comments 9 replies

Comment options

You must be logged in to vote
4 replies
@josephine-wolf-oberholtzer
Comment options

@dayunbao
Comment options

@josephine-wolf-oberholtzer
Comment options

@josephine-wolf-oberholtzer
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@dayunbao
Comment options

@josephine-wolf-oberholtzer
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@josephine-wolf-oberholtzer
Comment options

Answer selected by dayunbao
Comment options

You must be logged in to vote
2 replies
@josephine-wolf-oberholtzer
Comment options

@josephine-wolf-oberholtzer
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants