# How to play a sound or tone when a program ends?

**URL:** <https://discourse.julialang.org/t/how-to-play-a-sound-or-tone-when-a-program-ends/41239>\
**Category:** General Usage\
**Tags:** sound\
**Created:** [June 12, 2020, 2:39am UTC](https://discourse.julialang.org/t/how-to-play-a-sound-or-tone-when-a-program-ends/41239 "2020-06-12T02:39:48Z")\
**Posts on this page:** 1\
**Showing post:** 29

<div class="post-metadata">

**Author:** ![cesquerre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cesquerre/32/205867_2.png) [@cesquerre](https://discourse.julialang.org/u/cesquerre)\
**Post date:** [December 19, 2023, 11:51am UTC](https://discourse.julialang.org/t/how-to-play-a-sound-or-tone-when-a-program-ends/41239/29 "2023-12-19T11:51:49Z")

</div>

‘wavplay’ from [WAV · Julia Packages](https://juliapackages.com/p/wav) worked fine for me.

```julia
using WAV
y, fs = wavread("foo.wav")

```

Anywhere in your program where you want to play the sound in the file foo.wav, just add the line.

```julia
wavplay(y, fs)

```

Also you can try Beep.jl ([GitHub - arubhardwaj/Beep.jl: Notify me, Julia! I cannot remember after executing the script!!](https://github.com/arubhardwaj/Beep.jl/tree/main)).

---

_[View the full topic](https://discourse.julialang.org/t/how-to-play-a-sound-or-tone-when-a-program-ends/41239)._
