NOOK Color sound doesn't work

I had my apps built with 840 and everything worked great.
Now after the new HD+ I had to rebuild with 925.
I uploaded the new APK and was rejected.
The reason was my on/off sound button worked only to turn it off but not to turn it back on again. I tested it on the simulator and it works. I tested on my Nook Color and it doesn’t. Whyyyyyyy???
Anybody else has the same issue?
[import]uid: 12407 topic_id: 31697 reply_id: 331697[/import]

In the interest of isolating this, if you compile a sample code with audio, do you see the same issue between the 2 builds? [import]uid: 26 topic_id: 31697 reply_id: 126657[/import]

FYI, I recently had an app rejected 5 times before I changed all my sound files to .mp3 - then it was accepted. [import]uid: 40033 topic_id: 31697 reply_id: 126658[/import]

@Walter
The code involves using the audio.stop() which works to stop the sound in my app. But when I try to play the same sound again it would not do anything at all.
There is a live version of my app “Minifono Candy Toy Phone” in both the Nook store and the App Store. Both are built with 840 and they work fine. But when I rebuilt with 925/929 it would do the audio.stop issue. So in other words if you download my app from the Nook Store it works fine but if I rebuild with the latest build it doesn’t (NOTE: it works on the simulator but not in the device Nook Color).

Now I found a work around:

@Pixin
You’re the man, I changed the sound file from OGG to MP3 and now it magically works!

So there you go.
I hope this help to anybody experiencing the same issue.

Thanks
[import]uid: 12407 topic_id: 31697 reply_id: 126676[/import]

Great! [import]uid: 40033 topic_id: 31697 reply_id: 126679[/import]

Everyone,

I’m not able to reproduce this audio issue. I tried our sample app “Media/AudioPlayer” built with build #929, playing the OGG audio file, and it would always resume right where it left off after suspending/resuming the app.

Now, in order to test this, I had to add the default status bar to the app or else the Nook’s “n” button will be treated as a Back key instead of a Home key. Meaning that if there is no status bar, then there is no way to suspend the app, meaning that the “n” button will always exit the app which would kill the audio stream. So, perhaps this is what happened to the app reviewer? The person pressed the “n” button thinking it would suspend the app but it really exited the app… in which case there is no bug and the app reviewer made a mistake. [import]uid: 32256 topic_id: 31697 reply_id: 126843[/import]

@Walter i had this same issue, it is something to do with the way you are using the audio stream.
If you play and stop and try to play again I think I recall that’s where the issue was.
Try using Play and Resume, Pause like in my toggle function below

loca MusicChannel=nil;  
  
local function toggleAudio()  
 if \_G.settings.AudioSet == true then  
 if MusicChannel == nil then   
 MusicChannel = audio.loadStream(\_G.audioDir .. musicfile )  
 audio.play(MusicChannel,{channel=1, loops=-1 })   
 else  
 audio.resume(MusicChannel )  
 end   
 else  
 --if MusicChannel ~= nil then audio.pause(MusicChannel) end  
 if MusicChannel ~= nil then audio.pause(1) end -- Pause the music until the use resumes play  
 end  
 -- can dispose it.  
 -- audio.dispose(MusicChannel)  
end  

Larry Meadows
www.DoubleSlashDesign.com [import]uid: 11860 topic_id: 31697 reply_id: 126849[/import]

@Joshua

This issue happens on my Nook Color and only using OGG files and using the audio.stop() function. When I try to play the the same OGG file again it wouldn’t work. Let me show you my code:

[lua]function musicOn(event)
if(event.phase == “began”) then
if(playSound) then
local availableChannel = audio.findFreeChannel()
local bkgSound = audio.loadSound(“sound.ogg”)
audio.play( bkgSound ,{ channel = availableChannel , loops=-1} )

playSound = false

else
audio.stop()
playSound = true
end
end
end[/lua]

@Larry

Thanks Larry, that’s exactly what’s happening, I will definitely use your approach from now on.
[import]uid: 12407 topic_id: 31697 reply_id: 126852[/import]

anytime :slight_smile:

Larry Meadows
www.DoubleSlashDesign.com
[import]uid: 11860 topic_id: 31697 reply_id: 126853[/import]

In the interest of isolating this, if you compile a sample code with audio, do you see the same issue between the 2 builds? [import]uid: 26 topic_id: 31697 reply_id: 126657[/import]

FYI, I recently had an app rejected 5 times before I changed all my sound files to .mp3 - then it was accepted. [import]uid: 40033 topic_id: 31697 reply_id: 126658[/import]

Thanks Larry, I’ll definitely try this too, will save me from having to convert my audio! [import]uid: 40033 topic_id: 31697 reply_id: 126857[/import]

@Walter
The code involves using the audio.stop() which works to stop the sound in my app. But when I try to play the same sound again it would not do anything at all.
There is a live version of my app “Minifono Candy Toy Phone” in both the Nook store and the App Store. Both are built with 840 and they work fine. But when I rebuilt with 925/929 it would do the audio.stop issue. So in other words if you download my app from the Nook Store it works fine but if I rebuild with the latest build it doesn’t (NOTE: it works on the simulator but not in the device Nook Color).

Now I found a work around:

@Pixin
You’re the man, I changed the sound file from OGG to MP3 and now it magically works!

So there you go.
I hope this help to anybody experiencing the same issue.

Thanks
[import]uid: 12407 topic_id: 31697 reply_id: 126676[/import]

Great! [import]uid: 40033 topic_id: 31697 reply_id: 126679[/import]

Adrian,

I just tried doing an audio.play(), audio.stop(), and then audio.play() again on an OGG file and it worked as expected on a Nook Color. I tried stopping a specific channel and calling audio.stop() with no arguments. I also tried pausing and resuming the OGG playback… it still worked. I just can’t reproduce this issue that you are seeing.

Are you able to reproduce this issue with our “Media/AudioPlayer” sample project on your Nook Color? I would recommend that you give it a try. I’m interested in the results.

I also recommend that you look at the Android log via “adb logcat” or “ddms” with your app to see if any errors come up in the log having to do with audio. [import]uid: 32256 topic_id: 31697 reply_id: 126900[/import]

Everyone,

I’m not able to reproduce this audio issue. I tried our sample app “Media/AudioPlayer” built with build #929, playing the OGG audio file, and it would always resume right where it left off after suspending/resuming the app.

Now, in order to test this, I had to add the default status bar to the app or else the Nook’s “n” button will be treated as a Back key instead of a Home key. Meaning that if there is no status bar, then there is no way to suspend the app, meaning that the “n” button will always exit the app which would kill the audio stream. So, perhaps this is what happened to the app reviewer? The person pressed the “n” button thinking it would suspend the app but it really exited the app… in which case there is no bug and the app reviewer made a mistake. [import]uid: 32256 topic_id: 31697 reply_id: 126843[/import]

@Walter i had this same issue, it is something to do with the way you are using the audio stream.
If you play and stop and try to play again I think I recall that’s where the issue was.
Try using Play and Resume, Pause like in my toggle function below

loca MusicChannel=nil;  
  
local function toggleAudio()  
 if \_G.settings.AudioSet == true then  
 if MusicChannel == nil then   
 MusicChannel = audio.loadStream(\_G.audioDir .. musicfile )  
 audio.play(MusicChannel,{channel=1, loops=-1 })   
 else  
 audio.resume(MusicChannel )  
 end   
 else  
 --if MusicChannel ~= nil then audio.pause(MusicChannel) end  
 if MusicChannel ~= nil then audio.pause(1) end -- Pause the music until the use resumes play  
 end  
 -- can dispose it.  
 -- audio.dispose(MusicChannel)  
end  

Larry Meadows
www.DoubleSlashDesign.com [import]uid: 11860 topic_id: 31697 reply_id: 126849[/import]

Thanks for your support Joshua.
I’m currently updating my other app to upload to Barnes and I’m having a problem with the OGG files using Windows 7 and build 929. Now it says :
WARNING: Failed to create audio sound (sounds/1.ogg)
Maybe you’re using a Mac? just a thought…
for now I’m just going to use mp3 or something else…
thanks
[import]uid: 12407 topic_id: 31697 reply_id: 127031[/import]

@Joshua

This issue happens on my Nook Color and only using OGG files and using the audio.stop() function. When I try to play the the same OGG file again it wouldn’t work. Let me show you my code:

[lua]function musicOn(event)
if(event.phase == “began”) then
if(playSound) then
local availableChannel = audio.findFreeChannel()
local bkgSound = audio.loadSound(“sound.ogg”)
audio.play( bkgSound ,{ channel = availableChannel , loops=-1} )

playSound = false

else
audio.stop()
playSound = true
end
end
end[/lua]

@Larry

Thanks Larry, that’s exactly what’s happening, I will definitely use your approach from now on.
[import]uid: 12407 topic_id: 31697 reply_id: 126852[/import]

anytime :slight_smile:

Larry Meadows
www.DoubleSlashDesign.com
[import]uid: 11860 topic_id: 31697 reply_id: 126853[/import]