# Is there something so I can play a noise when Julia finished running? Like I have

**URL:** <https://discourse.julialang.org/t/is-there-something-so-i-can-play-a-noise-when-julia-finished-running-like-i-have/55107>\
**Category:** General Usage\
**Tags:** sound\
**Created:** [February 12, 2021, 1:16am UTC](https://discourse.julialang.org/t/is-there-something-so-i-can-play-a-noise-when-julia-finished-running-like-i-have/55107 "2021-02-12T01:16:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![BridgeBot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bridgebot/32/21491_2.png) [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Post date:** [February 12, 2021, 1:16am UTC](https://discourse.julialang.org/t/is-there-something-so-i-can-play-a-noise-when-julia-finished-running-like-i-have/55107/1 "2021-02-12T01:16:09Z")

</div>

is there something so I can play a noise when Julia finished running? Like I have a function

```julia
function foo(beta)
    beta[1].^2.0 - beta[2].^0.5

    #Function that pops off a sound
    noise() #Does this exist?
end

```

and want a sound to pop off in the end

Note that the original poster on Slack cannot see your response here on Discourse. Consider _transcribing the appropriate answer back to Slack_, or pinging the poster here on Discourse so they can _follow this thread_.  
[(Original message :slack:)](https://julialang.slack.com/archives/C6A044SQH/p1613092554104900?thread_ts=1613092554.104900&cid=C6A044SQH) [(More Info)](https://github.com/JuliaCommunity/SlackBridge)

---

<div class="post-metadata">

**Author:** ![haberdashPI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/haberdashpi/32/26337_2.png) [@haberdashPI](https://discourse.julialang.org/u/haberdashPI)\
**Post date:** [February 12, 2021, 12:43pm UTC](https://discourse.julialang.org/t/is-there-something-so-i-can-play-a-noise-when-julia-finished-running-like-i-have/55107/2 "2021-02-12T12:43:48Z")

</div>

One option: you can try my package, [Alert.jl](https://github.com/haberdashPI/Alert.jl). It creates a notification, which, depending on your os settings will play a sounds as well.

---

<div class="post-metadata">

**Author:** ![davide](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davide/32/52136_2.png) [@davide](https://discourse.julialang.org/u/davide)\
**Post date:** [February 12, 2021, 1:33pm UTC](https://discourse.julialang.org/t/is-there-something-so-i-can-play-a-noise-when-julia-finished-running-like-i-have/55107/3 "2021-02-12T13:33:08Z")

</div>

You can use the `run` command to play a sound with a music player.  
In linux I use the following:

> run(`play "pathToFolder/soundFileName"`, wait=false)

e.g.

> run(`play "mySound.mp3"`, wait=false)

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [February 12, 2021, 1:34pm UTC](https://discourse.julialang.org/t/is-there-something-so-i-can-play-a-noise-when-julia-finished-running-like-i-have/55107/4 "2021-02-12T13:34:17Z")

</div>

`print('\u0007')` prints the [BEL character](https://en.wikipedia.org/wiki/Bell_character), which in many terminals will cause a beep to sound. `print('\u0007'^5)` for 5 beeps.

---

<div class="post-metadata">

**Author:** ![lwhitefox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lwhitefox/32/4363_2.png) [@lwhitefox](https://discourse.julialang.org/u/lwhitefox)\
**Post date:** [February 12, 2021, 2:56pm UTC](https://discourse.julialang.org/t/is-there-something-so-i-can-play-a-noise-when-julia-finished-running-like-i-have/55107/5 "2021-02-12T14:56:28Z")

</div>

On Mac OS, my favorite is to put a line with

```julia
run(`say \"I am done\"`)

```

It’s kind of fun to watch the reactions of nearby colleagues too when the oracle speaks.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [January 10, 2023, 8:52pm UTC](https://discourse.julialang.org/t/is-there-something-so-i-can-play-a-noise-when-julia-finished-running-like-i-have/55107/6 "2023-01-10T20:52:45Z")

</div>

For those on Windows, some text-to-speech can be called using:

```julia
str = "I'm done!"
run(`powershell -Command "\$sp = New-Object -ComObject SAPI.SpVoice; \$sp.Speak(\"$str\")"`)

```

And a basic beep, with pitch and duration, using:

```julia
run(`powershell -Command "[console]::beep(600,300)"`)

```
