Comments (8)
One possible feature would be the "exclusive mode" of WASAPI, see http://stackoverflow.com/questions/31306010/how-to-enable-wasapi-exclusive-mode-in-pyaudio
from python-sounddevice.
PaAlsa_EnableRealtimeScheduling
might be interesting for ALSA: http://portaudio.com/docs/v19-doxydocs-dev/pa__linux__alsa_8h.html#accc41e7fd89dc0a6163d54a4f25fb242
from python-sounddevice.
It would be interesting to be able to select arbitrary channels for input and output. On Windows this is needed with ASIO. If you currently want to send data to output channels 9 and 10, you have to send data to all channels below 11. This means that sharing the soundcard with other applications becomes impossible.
The hostapis WDM-KS, MME, Directsound, normally only present 2 channels so it is not a problem there.
from python-sounddevice.
@raecke I created an experimental implementation in #34. Can you please check if it works for you and leave a comment there?
from python-sounddevice.
There is also PaAlsa_SetNumPeriods
, which is by default set to 4
, which seems random:
By default the number of periods is 4, this is the lowest number of periods that works well on the author's soundcard.
http://portaudio.com/docs/v19-doxydocs-dev/pa__linux__alsa_8h.html#a76f60d6f1ba6a298c038a9f3a6dccc53
It looks like this has to be called before opening a stream.
from python-sounddevice.
OK, I'm trying to make an exhaustive list of the current host-API-specific settings, let's see if that works:
hostApiSpecificStreamInfo
to be specified separately for the input and output device when creating a stream:
- PaAlsaStreamInfo::deviceString, only works if device index is set to
paUseHostApiSpecificDeviceSpecification
(a.k.a.-2
) - PaAsioStreamInfo::channelSelectors, needs
PaAsioStreamInfo::flags
to containpaAsioUseChannelSelectors
- PaMacCoreStreamInfo::channelMap, can be set with
PaMacCore_SetupChannelMap
- PaMacCoreStreamInfo::flags,
paMacCoreChangeDeviceParameters
,paMacCoreFailIfConversionRequired
,paMacCoreConversionQuality*
, ... - PaWinDirectSoundStreamInfo::channelMask, needs
paWinDirectSoundUseChannelMask
flag - PaWinDirectSoundStreamInfo::framesPerBuffer, needs
paWinDirectSoundUseLowLevelLatencyParameters
flag - PaWasapiStreamInfo::channelMask, needs
paWinWasapiUseChannelMask
flag - PaWasapiStreamInfo::flags,
paWinWasapiExclusive
,paWinWasapiPolling
- PaWasapiStreamInfo::hostProcessorOutput, needs
paWinWasapiRedirectHostProcessor
flag, separate callback instead of "normal" audio callback? - PaWasapiStreamInfo::hostProcessorInput
- PaWasapiStreamInfo::threadPriority, needs
paWinWasapiThreadPriority
flag, cannot be different for input and output! - PaWasapiStreamInfo::streamCategory
- PaWasapiStreamInfo::streamOption
- PaWDMKSSpecificStreamInfo::input ???
- PaWDMKSSpecificStreamInfo::output ???
- PaWinWDMKSInfo::channelMask ???
- PaWinWDMKSInfo::flags ???
- PaWinMmeStreamInfo::framesPerBuffer
- PaWinMmeStreamInfo::bufferCount
- PaWinMmeStreamInfo::devices, needs
paWinMmeUseMultipleDevices
flag - PaWinMmeStreamInfo::channelMask, needs
paWinMmeUseChannelMask
flag - PaWinMmeStreamInfo::flags:
paWinMmeDontThrottleOverloadedProcessingThread
,paWinMmeWaveFormatDolbyAc3Spdif
,paWinMmeWaveFormatWmaSpdif
Functions that are called with a stream pointer:
- PaAlsa_EnableRealtimeScheduling
- PaAlsa_GetStreamInputCard
- PaAlsa_GetStreamOutputCard
- PaAsio_SetStreamSampleRate
- PaMacCore_GetStreamInputDevice
- PaMacCore_GetStreamOutputDevice
- PaWasapi_GetFramesPerHostBuffer, for use with
PaWasapiHostProcessorCallback
- PaWinMME_GetStreamInputHandle
- PaWinMME_GetStreamOutputHandle
Global functions:
- PaAlsa_SetNumPeriods
- PaAlsa_SetRetriesBusy
- PaAlsa_SetLibraryPathName Does this work with the way we are loading the library?
- PaAsio_GetAvailableBufferSizes, takes the device index
- PaAsio_ShowControlPanel, takes the device index and "the calling application's main window handle", does this work in Python?
- PaAsio_GetInputChannelName, takes the device index
- PaAsio_GetOutputChannelName, takes the device index
- PaJack_SetClientName, must be called before
Pa_Initialize
! - PaJack_GetClientName
- PaMacCore_GetChannelName, takes device and channel index
- PaMacCore_GetBufferSizeRange, takes device index
- PaWasapi_GetDeviceDefaultFormat, takes device index
- PaWasapi_GetDeviceRole, takes device index
- PaWasapi_ThreadPriorityBoost, for blocking interface only
- PaWasapi_ThreadPriorityRevert
- PaWasapi_GetJackCount, takes device index
- PaWasapi_GetJackDescription, takes device index
PaWasapi_IsLoopback
(will be in PortAudio 19.8), takes device index
from python-sounddevice.
Would love to be able to fetch PaAsio_GetInputChannelName
and PaAsio_GetOutputChannelName
though it looks like there hasn't been much movement on this feature?
from python-sounddevice.
@philipmountifield Can you please create a new issue with your request, including a suggestion how the new API should look like?
from python-sounddevice.
Related Issues (20)
- Cannot get aggregate device to work with sounddevice/rtmixer signal processing.py example HOT 1
- Enhancement Request: Integrate Playback Status Check into Simple `play`/`stop` API in `sounddevice` HOT 4
- Feature request for loopback of output device. HOT 3
- 设备解码错误?utf-8' codec can't decode byte 0xc2 in position 6: invalid continuation byte HOT 4
- Sounddevice + big dict + OOP = Segfault / Bus Error HOT 11
- Update device list by reloading portaudio dll HOT 1
- Won't be able to import sounddevice due to unknown issue with `libportaudio64bit.dll` HOT 5
- Error opening OutputStream: Unanticipated host error', -9999, (2, 0, 'Failed to load ASIO driver
- Use sounddevice with virtual audio device and minimize latency HOT 1
- Achieving stable latency between calls of "playrec" HOT 8
- sounddevice not recognize all devices?
- Issues with playing concurrently with Youtube HOT 1
- Latency 30mSec HOT 9
- Advice on asynchronous playback HOT 7
- docker node minimal image
- Can I continue recording until the volume drops below a threshold? HOT 4
- Simultaneous audio playback datatype issue HOT 2
- Does sd.wait() block all other threads? HOT 1
- OSERROR portaudio library not found
- Advice on detecting when Sounddevice has stopped playing audio (and using multiple OutputStreams)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-sounddevice.