Methods list

Methods usage

Sound.SoundModule
Sound

Module that exports wrappers around audio methods in PortAudio.

  • sound and soundsc : methods for audio playback.
  • record : method for audio recording.
source
Sound.pick_outputMethod
pick_output( ; io_in::IO = stdin, io_out::IO = stdout)

Show available audio devices and prompt user to select output device.

source
Sound.recordFunction
data, S = record(time::Real = 5; input_device, args=(1,0), chat::Bool=true)

Record time seconds of audio data using input_device (typically defaults to the built-in microphone).

Input

  • time : duration; 5 seconds by default

Option

  • input_device::PortAudioDevice = get_default_input_device() system default
  • args : arguments to PortAudioStream; (1,0) for single-channel input by default
  • chat : show begin/end message? true by default

Output

  • data : Vector of length time * S
  • S : sample_rate of input stream
source
Sound.soundFunction
sound(x::AbstractVector, S::Real = framerate(x), args...; kwargs...)

Play monophonic audio signal x at sampling rate S samples per second through default audio output device using the PortAudio package. Caller must specify S unless a framerate method is defined for x.

source
Sound.soundFunction
sound(output_device_index::Int, x, S::Real = framerate(x); kwargs...)

Play sound in x using devices()[output_device_index].

source
Sound.soundFunction
sound(x::AbstractMatrix, S::Real = framerate(x) [, output_device])

Play stereo audio signal x at sampling rate S samples per second through default audio output device using the PortAudio package. Caller must specify S unless a framerate method is defined for x.

source
Sound.soundFunction
sound(:pick, x, S::Real = framerate(x); kwargs...)

Prompt user to pick output device, then play sound in x.

source
Sound.soundMethod
sound(sb::SampleBuf)

Play audio signal sb of type SampleBuf through default audio output device using the PortAudio package.

source
Sound.soundscFunction
soundsc(x, S::Real = framerate(x), args...; kwargs...)

Call sound after scaling x to have values in (-1,1).

source
Sound.soundscMethod
soundsc(sb::SampleBuf)

Play audio signal sb of type SampleBuf through default audio output device using the PortAudio package, after scaling the data to have values in (-1,1).

source