loadSound lag game

Hello.

I have a problem with jamming play music while charging.

local backgroundMusic = audio.loadSound( "backgroundMusic.mp3" )

When loading the second stage and immediately loading music playing jams for a while and then cuts off and starts to play music.

Sorry for my bad english.

Hi @rekimokontakt,

Loading large audio files into memory can cause a delay/skip. You should always attempt to pre-load large audio files, or use “audio.loadStream()” to play longer audio files (like music tracks).

https://docs.coronalabs.com/api/library/audio/loadStream.html

Take care,

Brent

on “audio.loadStream()” music no start

Hello again,

Loading an audio file into memory doesn’t automatically play it. That requires a separate command.

On this note, have you fully explored audio usage and how it works in Corona? This topic should be researched a little before you dive into it… there are some fundamental aspects to understand about how audio files and handles work, channels are assigned/used, audio is cleared from memory, etc. The following guide should help:

https://docs.coronalabs.com/guide/media/audioSystem/index.html

Brent

local backgroundMusic = audio.loadStream( "backgroundMusic.mp3" ) audio.play(backgroundMusic ,{ channel=1, loops=-1, fadein=5000})

Hi @rekimokontakt,

Loading large audio files into memory can cause a delay/skip. You should always attempt to pre-load large audio files, or use “audio.loadStream()” to play longer audio files (like music tracks).

https://docs.coronalabs.com/api/library/audio/loadStream.html

Take care,

Brent

on “audio.loadStream()” music no start

Hello again,

Loading an audio file into memory doesn’t automatically play it. That requires a separate command.

On this note, have you fully explored audio usage and how it works in Corona? This topic should be researched a little before you dive into it… there are some fundamental aspects to understand about how audio files and handles work, channels are assigned/used, audio is cleared from memory, etc. The following guide should help:

https://docs.coronalabs.com/guide/media/audioSystem/index.html

Brent

local backgroundMusic = audio.loadStream( "backgroundMusic.mp3" ) audio.play(backgroundMusic ,{ channel=1, loops=-1, fadein=5000})