Play and Record Sound with Python§
This Python module provides bindings for the PortAudio library and a few convenience functions to play and record NumPy arrays containing audio signals.
The sounddevice module is available for Linux, macOS and Windows.
- Documentation:
- Source code repository and issue tracker:
- License:
MIT – see the file
LICENSEfor details.
- Installation
- Usage
- Example Programs
- Play a Sound File
- Play a Very Long Sound File
- Play a Very Long Sound File without Using NumPy
- Play a Web Stream
- Play a Sine Signal
- Input to Output Pass-Through
- Plot Microphone Signal(s) in Real-Time
- Real-Time Text-Mode Spectrogram
- Recording with Arbitrary Duration
- Using a stream in an
asynciocoroutine - Creating an
asynciogenerator for audio blocks
- Contributing
- API Documentation
- Convenience Functions using NumPy Arrays
- Checking Available Hardware
- Module-wide Default Settings
- Platform-specific Settings
- Streams using NumPy Arrays
StreamStream.abort()Stream.activeStream.blocksizeStream.channelsStream.close()Stream.closedStream.cpu_loadStream.deviceStream.dtypeStream.latencyStream.read()Stream.read_availableStream.samplerateStream.samplesizeStream.start()Stream.stop()Stream.stoppedStream.timeStream.write()Stream.write_available
InputStreamOutputStream
- Raw Streams
- Miscellaneous
- Expert Mode
- Version History