Page 1 of 1

I cant get my audio to play

Posted: Mon Dec 02, 2024 5:18 pm
by justthoseguys12
the audio for the code won't play even though there is a love.audio.play here is the code and the file

Code: Select all

function love.load()
  whale = love.graphics.newImage("whale.jpg")

  follow = love.graphics.newImage("follow.png")

  gofollow = love.graphics.newImage("Go follow.png")

  cowbelly = love.graphics.newVideo("Cowbelly.ogv")

  cowbellyaudio = love.audio.newSource("cowbelly.mp3", "static")
  love.audio.play(cowbellyaudio)

  love.window.setFullscreen(true, "desktop")
end
function love.draw()
	love.graphics.draw(whale, 300, 200) 

        love.graphics.draw(follow, 200, 500)

        love.graphics.draw(gofollow, 200, 100)

        love.graphics.draw(cowbelly, 700, 100)
        cowbelly:play()
end
function love.keypressed(key, scancode, isrepeat)
   if key == "escape" then
      love.event.quit()
   end
end

Re: I cant get my audio to play

Posted: Mon Dec 02, 2024 6:13 pm
by thesandrobrito
Try cowbellyaudio:play() instead of love.audio.play(cowbellyaudio)

Re: I cant get my audio to play

Posted: Mon Dec 02, 2024 7:05 pm
by justthoseguys12
that dident work but thanks for trying

Re: I cant get my audio to play

Posted: Mon Dec 02, 2024 8:58 pm
by thesandrobrito
strange, that worked for me with my audio. Could it be a problem of the audio file? have you tried another one?

Re: I cant get my audio to play

Posted: Tue Dec 03, 2024 2:56 pm
by justthoseguys12
yes i changed it to ogg file and it might just be a problem on this computer so i can try a diffrent computer and i will update you on it later