TODO: Add Badges
This is a Julia package to play audio using the PulseAudio daemon common on Linux systems. This was originally part of @dancasimiro's WAV.jl package but has been split out and adapted to the JuliaAudio ecosystem.
PulseAudio.jl supports the SampledSignals.jl API, and provides a writable stream. Simply create a stream with the PulseAudioSource
constructor. These stream will accept regular Array
s with each channel as a column, or you can use SampledSignals' SampleBuf
values to take advantage of automatic sample-rate and element type conversions.
sig = sin.(2pi*330*linspace(0, 0.5, 0.5*48000)) * 0.2;
sink = PulseAudioSink()
write(sink, sig)
close(sink)
buf = load("somefile.wav")
sink = PulseAudioSink()
# if the samplerates don't match the data will be transparently resampled
write(sink, buf)
close(sink)
buf = load("somefile.wav")
sink = PulseAudioSink(name="Downsampled", description="8kHz", samplerate=8000)
write(sink, buf)
close(sink)