Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to play a sound in Julia

Tags:

audio

julia

I'm programming in Julia and I would like to reproduce some simple audio, like single notes or similar.

I was wondering whether there is a way or a library to reproduce simple sounds. Is there anybody who know it?

like image 212
raskolnikov Avatar asked Dec 19 '20 16:12

raskolnikov


People also ask

Should I learn Julia?

If you are into scientific computing, you probably have already heard about Julia, the magical language that aims to be (almost) as fast as C and as easy as MATLAB and Python to write. I have been playing with Julia for more than a year now, and I really like it and recommend checking it out. The objective of this post is not to teach you Julia.

How do I install a package in Julia?

Installing packages in Julia is easy. Just run the following commands in the Julia REPL: where "PackageName" is the name of the package you want to install ( without the .jl suffix). If you want to follow along using the notebook, you can download it from this GitHub repository.

How many packages does Julia have to offer?

I know this is all really basic, but Julia has much more to offer. There are currently 429 packages (and counting) available to install via the package manager and much more in development on GitHub. Package development has been especially strong in the statistics/machine learning and optimization domains.

What are the different types of signal processing in Julia?

DSP.jl: signal processing functions (filtering, spectrograms/periodograms, window functions...). WAV.jl: loading/writing WAV files. PyPlot.jl: a Julia interface to the Matplotlib plotting library. This is actually a Python library, but there is very little overhead (for examples, arrays are passed to it without making copies).


1 Answers

Assuming that you need this for things like having a sound signal to let yourself know that your computations has finished this will work:

using WAV
y, fs = wavread(raw"C:\Windows\Media\Ring01.wav")
wavplay(y, fs)
like image 190
Przemyslaw Szufel Avatar answered Nov 30 '22 04:11

Przemyslaw Szufel