Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

All audio seems to start with an undesired fade-in
Started by dejan2 Mar 02 2019 08:09 AM

5 replies to this topic
audio fade

Best Answer dejan2 , 04 March 2019 - 01:23 PM

Thanks for answering. After some testing, the issue seems to be Corona-3462 which I use on my mac. On the Windows version of Corona Simulator this issue is not present, nor on Android devices, so it's solved, it's a mac-corona-simulator issue. 

[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

dejan2

[GLOBAL: userInfoPane.html]
dejan2
  • Observer

  • 3 posts
  • Corona SDK

Hello
 
when my game starts, an 8 sec intro plays and when that is finished, I want to loop the main theme.

 

[lua=auto:0]

--in main.lua:

audio.reserveChannels(1)

 

--in game.lua's scene:create

 musicTrack = audio.loadStream("audio/gameTheme.wav")

 introTrack = audio.loadStream("audio/gameIntro.wav")

 

 

--in game.lua's scene:show

audio.play(introTrack, {channel=1, loops=0,

    onComplete=function()

    --audio.stop(1) --doesn't seem to help or do anything
    audio.play(musicTrack, {channel=1, loops=-1})
end})
[\lua]
 
this above demo works, except that musicTrack starts playing by fading in, so there is an audible silence between musicIntro ending and musicTrack fading in. Adding "fadein=0" to the options did not work. How can I resolve this issue?
 
kind regards
 
PS
I also tried playing them on different channels, same result.
I also tried to execute audio.play(musicTrack,...) inside a performWithDelay instead of onComplete, but again, the undesired fade-in occured.
 


[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,072 posts
  • Enterprise

You might want to check the audio files and make sure they don't have fades built in. None of your code would attempt to fade a channel.

 

Rob



[TOPIC: post.html]
#3

dejan2

[GLOBAL: userInfoPane.html]
dejan2
  • Observer

  • 3 posts
  • Corona SDK

  Best Answer

Thanks for answering. After some testing, the issue seems to be Corona-3462 which I use on my mac. On the Windows version of Corona Simulator this issue is not present, nor on Android devices, so it's solved, it's a mac-corona-simulator issue. 



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,072 posts
  • Enterprise

Can you put together a sample project that demonstrates this? If we have a bug, it would be nice to fix it and if you have a project (main.lua, config.lua, build.settings, the audio files in question) and can put it in a .zip file and share a link to the zip file on DropBox or Google Drive or similar, we can try to find the problem.

 

Rob



[TOPIC: post.html]
#5

dejan2

[GLOBAL: userInfoPane.html]
dejan2
  • Observer

  • 3 posts
  • Corona SDK

Does this link work for you? https://wetransfer.com/downloads/7ba1ed43bed439222eeab79fdaf96b6a20190304214015/61d12f7740504df36d26e8cf12b98b4b20190304214015/bb9670

 

It's just basic Balloon tap with a simple drum beat: first it plays the intro once, and then it seamlessly transitions into the main beat loop, except on mac. The interesting stuff happens from line 6 to 15 in main.lua.



[TOPIC: post.html]
#6

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,072 posts
  • Enterprise

I've filed this as a bug!

 

Rob




[topic_controls]
[/topic_controls]