Sound overview
This page illustrates the Julia package Sound.
This page comes from a single Julia file: 01-overview.jl.
You can access the source code for such Julia documentation using the 'Edit on GitHub' link in the top right. You can view the corresponding notebook in nbviewer here: 01-overview.ipynb, or open it in binder here: 01-overview.ipynb.
Setup
Packages needed here.
using Sound
using SampledSignals: SampleBuf
using InteractiveUtils: versioninfoOverview
The primary purpose of this package, at least initially, was to provide a simple way to hear audio signals in Julia.
S = 8192 # sampling rate in Hz
x = 0.7*cos.(2π*(1:S÷2)*440/S)
y = 0.8*sin.(2π*(1:S÷2)*660/S)
isinteractive() && sound(x, S) # monophonicfalsestereo:
isinteractive() && sound([x y], S)falsescale to unit amplitude:
isinteractive() && soundsc([x y], S)falseUsing SampleBuf may provide some convenience.
S = 8192 # sampling rate in Hz
x = 0.7 * cos.(2π*(1:S÷2)*440/S)
y = 0.8 * sin.(2π*(1:S÷2)*660/S)
sb = SampleBuf([x y], S) # stereo data
isinteractive() && sound(sb)falseReproducibility
This page was generated with the following version of Julia:
using InteractiveUtils: versioninfo
io = IOBuffer(); versioninfo(io); split(String(take!(io)), '\n')12-element Vector{SubString{String}}:
"Julia Version 1.12.3"
"Commit 966d0af0fdf (2025-12-15 11:20 UTC)"
"Build Info:"
" Official https://julialang.org release"
"Platform Info:"
" OS: Linux (x86_64-linux-gnu)"
" CPU: 4 × AMD EPYC 7763 64-Core Processor"
" WORD_SIZE: 64"
" LLVM: libLLVM-18.1.7 (ORCJIT, znver3)"
" GC: Built with stock GC"
"Threads: 1 default, 1 interactive, 1 GC (on 4 virtual cores)"
""And with the following package versions
import Pkg; Pkg.status()Status `~/work/Sound.jl/Sound.jl/docs/Project.toml`
⌅ [717857b8] DSP v0.7.10
[e30172f5] Documenter v1.16.1
[98b081ad] Literate v2.21.0
[170b2178] MIRTjim v0.26.0
[91a5bcdd] Plots v1.41.3
[bd7594eb] SampledSignals v2.1.4
[afe32e48] Sound v0.5.0 `~/work/Sound.jl/Sound.jl`
[1986cc42] Unitful v1.27.0
[b77e0a4c] InteractiveUtils v1.11.0
Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading. To see why use `status --outdated`This page was generated using Literate.jl.