Author Archive

How to load an audio file as stream in Corona SDK ?

For loading an audio file as a stream in Corona sdk (for larger audio files),

BGMusic = audio.loadStream("sample.mp3")

Incoming search terms:

  • corona stream audio

Releasing a loaded audio from memory in Corona SDK

For releasing a loaded audio from memory in corona sdk,

urSound = audio.loadSound( "sample.wav" )
--Releasing Audio
audio.dispose( urSound )
urSound = nil  

For pausing and resuming a particular audio channel in Corona SDK,

BGMChannel = audio.play( BGMusic, { loops=-1 }  ) 

For pausing that particular channel,

audio.pause( BGMChannel )

For resuming that paused channel,

audio.resume( BGMChannel )

How to cancel a transition in Corona SDK ?

For canceling a transition in Corona SDK,

Suppose you have a transition like this,

local transNew = transition.to(urDisObj, { time=400, y=420, transition=easing.outQuad}) 

For canceling it,

transition.cancel(transNew)

Moving an object with retardation in Corona SDK

For moving an object with retardation in Corona SDK,

transition.to(urDispObj, { time=2400, y=450, transition=easing.outExpo})

Moving an object with acceleration in Corona SDK

For moving an object with acceleration in Corona SDK,

transition.to(urDispObj, { time=1400, y=220, transition=easing.inExpo}) 

For moving an object with constant speed without acceleration in Corona SDK,

 transition.to(urdispObj, {time=2000, y=460, transition = easing.linear})

Incoming search terms:

  • moving object constant speed corona
  • transition to corona speed

Two ways to remove a display object in Corona

For removing a display object in Corona use,

image.parent:remove( image ) 

OR

image:removeSelf( )

For displaying a text with custom font and size in corona,

local myText = display.newText( "Hello, World", 0, 0, "Helvetica", 18 )
myText:setTextColor(0, 0, 255)

Setting audio play frequency in Corona

For setting audio play frequency in corona, put the following code in config.lua,

 application =
  {
      content =
      {
         
          audioPlayFrequency = 22050
      },
  }

Supported values are 11025, 22050, 44100.

Page 20 of 34« First...10...1819202122...30...Last »
We Can Build Your App for You. Lets Get Started !