For some reason i cant put audio files into my programs

i used os module, playsound module, but no matter what it just says “bounce.wav is not in computer or directory” even though it is on my computer and i even put it on the same directory as my python program. am i doing something wrong? also im on linux by the way.

we’d need to see some code and your directory structure to see where your files are in relation to your code…

Traceback (most recent call last):
File “/home/gamerdyder/.local/lib/python3.9/site-packages/playsound.py”, line 261, in
playsound(argv[1])
File “/home/gamerdyder/.local/lib/python3.9/site-packages/playsound.py”, line 163, in _playsoundNix
gi.require_version(‘Gst’, ‘1.0’)
File “/usr/lib/python3/dist-packages/gi/init.py”, line 126, in require_version
raise ValueError(‘Namespace %s not available’ % namespace)
ValueError: Namespace Gst not available
Traceback (most recent call last):
File “/home/gamerdyder/mu_code/pong.py”, line 108, in
playsound(“bounce.wav”)
File “/home/gamerdyder/.local/lib/python3.9/site-packages/playsound.py”, line 254, in
playsound = lambda sound, block = True: _playsoundAnotherPython(‘/usr/bin/python3’, sound, block, macOS = False)
File “/home/gamerdyder/.local/lib/python3.9/site-packages/playsound.py”, line 229, in _playsoundAnotherPython
t.join()
File “/home/gamerdyder/.local/lib/python3.9/site-packages/playsound.py”, line 218, in join
raise self.exc
File “/home/gamerdyder/.local/lib/python3.9/site-packages/playsound.py”, line 211, in run
self.ret = self._target(*self._args, **self._kwargs)
File “/home/gamerdyder/.local/lib/python3.9/site-packages/playsound.py”, line 226, in
t = PropogatingThread(target = lambda: check_call([otherPython, playsoundPath, _handlePathOSX(sound) if macOS else sound]))
File “/usr/lib/python3.9/subprocess.py”, line 373, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[’/usr/bin/python3’, ‘/home/gamerdyder/.local/lib/python3.9/site-packages/playsound.py’, ‘bounce.wav’]’ returned non-zero exit status 1.

def paddle_a_up():
    y = paddle_a.ycor()
    y += 20
    paddle_a.sety(y)
    

def paddle_a_down():
    y = paddle_a.ycor()
    y -= 20
    paddle_a.sety(y)

def paddle_b_up():
    y = paddle_b.ycor()
    y += 20
    paddle_b.sety(y)

def paddle_b_down():
    y = paddle_b.ycor()
    y -= 20
    paddle_b.sety(y)

# keyboard binding
wn.listen()
wn.onkeypress(paddle_a_up, "w")
wn.onkeypress(paddle_a_down, "s")
wn.onkeypress(paddle_b_up, "Up")
wn.onkeypress(paddle_b_down, "Down")




# main game loop
while True:
    wn.update()


    # move the ball
    ball.setx(ball.xcor() + ball.dx)
    ball.sety(ball.ycor() + ball.dy)


    # Border checking
    if ball.ycor() > 290:
        ball.sety(290)
        ball.dy *= -1
        playsound("bounce.wav")

    if ball.ycor() < -290:
        ball.sety(-290)
        ball.dy *= -1

    if ball.xcor() > 390:
        ball.goto(0, 0)
        ball.dx *= -1
        score_a += 1
        pen.clear()
        pen.write("Player A: {}  PlayerB: {}".format(score_a, score_b), align="center", font=("Courier", 24, "normal"))

    if ball.xcor() < -390:
        ball.goto(0, 0)
        ball.dx *= -1
        score_b += 1
        pen.clear()
        pen.write("Player A: {}  PlayerB: {}".format(score_a, score_b), align="center", font=("Courier", 24, "normal"))

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

We need to see the code that generated this error (playsound.py)
and we need to see your directory structure
(that is, if you are on linux for eg, we need to see the output of an ls -a * or something similar to see where your files are in relation to each or you can just tell us the absolute path of each file)

Correction: I see you shared the code. You are writing the code as if the playsound.py and the file bounce.wav are in the same directory.
Are they?