Accept -1 as device index
This commit is contained in:
parent
fa3e88082c
commit
e4f0ad050e
|
@ -18,7 +18,7 @@ Audio I/O for real-time applications, like VoIP.
|
|||
Arguments are pairs of key=value.
|
||||
|
||||
### in & out:
|
||||
- `device`: The device, a number (Default: Your default audio device.)
|
||||
- `device`: The device, a number (Default: `-1` aka. your default device)
|
||||
- `format`: The encoding of your audio, choices: [https://people.csail.mit.edu/hubert/pyaudio/docs/#pasampleformat](https://people.csail.mit.edu/hubert/pyaudio/docs/#pasampleformat) (Default: `paUInt8`)
|
||||
- `channels`: How many channels the audio has (Default: `1`)
|
||||
- `bitrate`: How high the refresh rate of the audio is in Hz (Default: `8000`)
|
||||
|
|
|
@ -31,6 +31,7 @@ audioChannels = getSetting(settings,int,["c","channel","channels"],1)
|
|||
audioRate = getSetting(settings,int,["r","rate","bitrate"],8000)
|
||||
audioBuffer = getSetting(settings,float,["b","buffer","buffersize"],0.05)
|
||||
audioDevice = getSetting(settings,int,["d","device"],None)
|
||||
if audioDevice == -1: audioDevice = None
|
||||
|
||||
audioFormat = getattr(pyaudio,audioFormat)
|
||||
audioBuffer = round(audioRate * audioBuffer)
|
||||
|
|
|
@ -81,6 +81,7 @@ audioRate = getSetting(settings,int,["r","rate","bitrate"],8000)
|
|||
audioBuffer = getSetting(settings,float,["b","buffer","buffersize"],0.05)
|
||||
audioStore = getSetting(settings,float,["s","store"],0.3)
|
||||
audioDevice = getSetting(settings,int,["d","device"],None)
|
||||
if audioDevice == -1: audioDevice = None
|
||||
|
||||
letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
audioBitrate = audioFormat
|
||||
|
|
Loading…
Reference in New Issue