You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following code works as expected for me in a fresh Julia session if the first line is commented out.
#using Gtk # uncommenting this causes problems with wavplay!?using WAV: wavplay
S =8192
x =cos.(2pi*(1:S÷2)*440/S)
y =cos.(2pi*(1:S÷2)*660/S)
wavplay(x, S)
wavplay(y, S)
But uncommenting the first line causes intermittent problems, usually that the first tone x is never played.
I then have to restart Julia and comment out the first line for it to work again.
I am using Julia v1.6.4 with WAV v1.1.1 and Gtk v1.1.9, under MacOS Mojave 10.14.6.
I suspect that the issue is that both Gtk and WAV use a ccall with some type of run loop, like
and perhaps those interfere with each other, but I am surprised that merely adding using Gkt without calling any Gtk functions would cause such interference.
I am preparing to teach a course where students make a simply GUI-based synthesizer using Gtk buttons that produce tones when clicked, so I very much hope there is a solution to this.
The text was updated successfully, but these errors were encountered:
Hi Jeff, thanks for reporting this issue. I suspect that your hunch is correct and the WAV and Gtk code must coordinate how to invoke the core foundation run loop here. Does everything work if you comment out the WAV.jl invocation on line 374 and the "dispose" function call on line 375?
When I comment out those two lines, in both julia v1.6.4 and v1.7, both tones x and y are played (essentially?) simultaneously rather than sequentially! That is a potentially useful "feature" but is not what I was expecting. But maybe it helps you figure out what to try next?
If I comment out 375, but leave in 374, then it hangs (with GTK).
If I comment out 374 and leave in 375, then I get almost no sound (tiny blip the first time), but it does not hang.
Just to let you know, I have found an alternative for now using PortAudio that seems to play OK with Gtk. See https://github.com/JeffFessler/Sound.jl. So this is no longer urgent, but still it would be useful if wavplay would work with Gtk.
The following code works as expected for me in a fresh Julia session if the first line is commented out.
But uncommenting the first line causes intermittent problems, usually that the first tone
x
is never played.I then have to restart Julia and comment out the first line for it to work again.
I am using Julia v1.6.4 with WAV v1.1.1 and Gtk v1.1.9, under MacOS Mojave 10.14.6.
I suspect that the issue is that both Gtk and WAV use a
ccall
with some type of run loop, likeWAV.jl/src/wavplay-audioqueue.jl
Line 374 in 0dc24f6
and perhaps those interfere with each other, but I am surprised that merely adding
using Gkt
without calling any Gtk functions would cause such interference.I am preparing to teach a course where students make a simply GUI-based synthesizer using Gtk buttons that produce tones when clicked, so I very much hope there is a solution to this.
The text was updated successfully, but these errors were encountered: