Best way to save a trained model in PyTorch? 4485.Is possible pass reference type to object instance which needs reference type dynamically? 4139.What's the correct parameter value of System.getenv('OUTPUT_PATH')? 742.
readframes (chunk) # Close and terminate the stream readframes (chunk) # Play the sound by writing the audio data to the stream while data!= '': stream. getframerate (), output = True) # Read data in chunks data = wf. Stream object to write the WAV file to # 'output = True' indicates that the sound will be played rather than recorded stream = p. Browse other questions tagged python macos audio or ask your own question. Playing and Recording Sound in Python – Real Python, This works very well for me on Mac OS X El Capitan, with Python 3.5. I haven't tested it, but this should work: import subprocess If you want to do away with external dependencies entirely, and are running OS X 10.5+, you can use the included command-line audio player, afplay, along with the subprocess module.