# Background music issue

**URL:** <https://discourse.processing.org/t/background-music-issue/35976>\
**Category:** Processing.py\
**Created:** [March 28, 2022, 10:13am UTC](https://discourse.processing.org/t/background-music-issue/35976 "2022-03-28T10:13:31Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![muffininwinter](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@muffininwinter](https://discourse.processing.org/u/muffininwinter)\
**Post date:** [March 28, 2022, 10:13am UTC](https://discourse.processing.org/t/background-music-issue/35976/1 "2022-03-28T10:13:31Z")

</div>

Not sure why these codes don’t work, there is an error message [mismatched input ‘\*’ expecting set null] ☹ I have installed the sound library and add the mp3 in the sketch folder… Anyone can do me a favor ;(

```auto
import processing.sound.*;
SoundFile file;

void setup(){
    file = new SoundFile(this, "chopin.mp3");
    file.play();

}    

void draw(){
}

```

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [March 28, 2022, 10:28am UTC](https://discourse.processing.org/t/background-music-issue/35976/2 "2022-03-28T10:28:02Z")

</div>

Hi

Make sure that you  
Load a soundfile from the /data folder of the sketch and your file name chopin.mp3 with same format

Also you can try and test the library examples

Note that in general void setup run just once with out loop

---

<div class="post-metadata">

**Author:** ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)\
**Post date:** [March 28, 2022, 10:38am UTC](https://discourse.processing.org/t/background-music-issue/35976/3 "2022-03-28T10:38:04Z")

</div>

> **[Reference](https://processing.org/reference/libraries/sound/SoundFile.html)**
>
> This is a Soundfile player which allows to play back and manipulate sound files. Supported formats are: WAV, AIF/AIFF, and MP3. MP3 decoding can be very slow on ARM processors (Android/Raspberry Pi), …

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [March 29, 2022, 10:17am UTC](https://discourse.processing.org/t/background-music-issue/35976/4 "2022-03-29T10:17:57Z")

</div>

> [@muffininwinter](#):
>
> mismatched input ‘\*’ expecting set null

Hello @muffininwinter,

This has happened to me before with the Processing IDE as I sometimes switch between modes (Java, Python, p5.js).

This is _Java_ code and I suspect you may be running it in _Python_ mode:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/2676958fd0118c3b025206f21168af998e3b9e7f.png)

Go to the _ **upper right of screen** _ and change to _Java_ mode and it works:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/d/d4ba047f8dd2af85b33d209fa0b47a47454f51f0.png)

`:)`

---

<div class="post-metadata">

**Author:** ![muffininwinter](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@muffininwinter](https://discourse.processing.org/u/muffininwinter)\
**Post date:** [March 31, 2022, 5:44am UTC](https://discourse.processing.org/t/background-music-issue/35976/5 "2022-03-31T05:44:20Z")

</div>

Thanks a lot, I really had no idea it’s about the mode… May I ask do you know how to write the python version of it 🙏 🙏  
Because it seems I couldn’t search the python code online

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [March 31, 2022, 10:49am UTC](https://discourse.processing.org/t/background-music-issue/35976/6 "2022-03-31T10:49:04Z")

</div>

> [@muffininwinter](#):
>
> May I ask do you know how to write the python version of it

I only dabble with Python and not able to help with this (adding sound) at this time.

I searched in this forum for:  
_Python audio_  
or  
_Python sound_

There are some topics.

I was not successful playing anything with my initial efforts.

`:)`

---

<div class="post-metadata">

**Author:** ![muffininwinter](https://avatars.discourse-cdn.com/v4/letter/m/258eb7/32.png) [@muffininwinter](https://discourse.processing.org/u/muffininwinter)\
**Post date:** [March 31, 2022, 2:04pm UTC](https://discourse.processing.org/t/background-music-issue/35976/7 "2022-03-31T14:04:26Z")

</div>

thank you so much for your effort !!!  
Have a nice day 😁 😁
