Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

wavrecord and simultaneous play and record #111

Open
bjarthur opened this issue Mar 23, 2024 · 7 comments
Open

wavrecord and simultaneous play and record #111

bjarthur opened this issue Mar 23, 2024 · 7 comments

Comments

@bjarthur
Copy link
Contributor

thanks @mgkuhn for refactoring the wavplay function awhile back. in that PR you mention the possibility of adding a wavrecord function. how hard would that be for someone (like me) who is not familiar with apple's AudioToolbox?

i specifically need actually to play and record at the same time, making sure that the incoming and outgoing samples are in sync. is there a tutorial or example somewhere that demonstrates how to do this?

@mgkuhn
Copy link
Contributor

mgkuhn commented Mar 25, 2024

@mgkuhn
Copy link
Contributor

mgkuhn commented Mar 25, 2024

I haven't done anything with the Core Audio API myself yet. In that wavplay PR, I just modernized existing Julia code that used it. (If one were to start adding recording or even a full-duplex audio interface to WAV, it would of course be nice to also cover the Win32 and PulseAudio interfaces eventually.)

@ATell-SoundTheory
Copy link

I'd like to recommend portaudio.jl as a cross-platform abstraction for low-level audio APIs. It surely makes sense to avoid duplicating this effort.

@bjarthur
Copy link
Contributor Author

i considered portaudio.jl, but it cannot do full-duplex as discussed in this to issue

@ssfrr
Copy link

ssfrr commented Mar 25, 2024

PortAudio.jl can definitely do simultaneous playback+record, though I can see how that issue would cause confusion.

Older versions of PortAudio.jl had a specific synced keyword that controlled how underruns and overruns were handled, and guaranteed that the input->output latency wouldn't change. That functionality was lost when we switched away from a callback approach.

@mgkuhn
Copy link
Contributor

mgkuhn commented Mar 25, 2024

@ssfrr Is there any alternative way in PortAudio.jl to retain guaranteed fixed input/output latency, which would be quite essential for real-time feedback algorithms, such as echo cancellation or a full-duplex modem.

@ssfrr
Copy link

ssfrr commented Mar 25, 2024

Don’t want to hijack this issue too much, but there’s a little more detail here and here

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants