I have a project that uses several sound files that I have stored on Dropbox but for some reason I cannot access them. Has something changed in Codea recently that makes Dropbox not useable.
@Scotty - I have just tried to access my Dropbox folder, not used it for a while as I tend to use iCloud, and I found Codea does not throw up the Dropbox path option when you are trying to set up a link. I was trying it in the latest beta and using the path in a readImage() load.
@sim @jfperusse - can you confirm this and identify the cause ?
@Scotty - could you tell us what Codea version your on and what iOS ?
Thanks, @Bri_G for your response. My Codea version is 3.12.3 and my iOS version is 17.5.1.
I see on my Gen3 iPad, tapping the gear icon I have the ability to link and unlink Dropbox for access to assets. I do not see that option on my iPad Air.
I had been spending time making sure all my projects that ran on my Gen3 work on my Air. That’s when I noticed this problem.
I created a simple test project that accesses a single sound asset and I cannot get that to work. (Incidentally, these are custom sound assets that I have created myself.)
This certainly is not an emergency issue but I’d sure like to get it solved.
Thanks for the assistance.
@Scotty - just checked other places where you would expect to be able to see Dropbox like in the side bar/main menu page under collections and right at the bottom under new collections. Not present.
@sim @jfperusse - looks like Codea can not access it.
Also note - on the left side bar on Codea main projects window, under collections you are presented with collection names but are unable to open/expand the collections to view the names/small icons of the assets - is that deliberate ?
@Bri_G I can see my assets in the lefthand sidebar by selecting External Documents folder then selecting the Dropbox folder.
But when I try to find my assets using the sound() function within my project I have problems. By selecting External Documents folder then selecting the Dropbox folder then add Sound “+” then select Dropbox from the Locations list I see my assets BUT they are faded out — as in not selectable. I hope that provides a clue.
Thanks again for your help.
@Bri_G Just a side note. You mentioned that you tend to use iDrive more than Dropbox. I don’t have a great deal invested in Dropbox other than the 58 sound assets used with this project I’m working on.
Would you recommend copying my sound files from Dropbox to the iCloud Drive and be done with DB?
Thanks again.
@Scotty - in a word - yes, but I don’t know how big your audio files are. If they are very big you may have to pay to extend your iCloud memory. If they are just sound effects then you should be able to store quite a lot of files there. I mainly use it for images and backup and have to keep a watch on the storage level.
It would certainly get you started. Are you using iCloud to store your project files there?
@Bri_G I have 58 m4a sound files associated with my project. All about 97k each so iCloud storage should not be a problem. Hopefully transferring the files from Dropbox to iCloud is as straightforward as is described after a Google search.
And, yes, my projects are saved to iCloud.
@Bri_G
If I can solve this mystery I believe I’m on track to solving the bigger problem that started this thread. I have included a simple project that plays a sound asset.
If “test” is left undefined then a sound asset is played as expected via sound() in draw(). Otherwise when “test” is defined I create a “soundFile” in setup() that I attempt to play in draw(). It fails and generates a warning message.
I use a text string to define “soundFile” that appears equivalent to the asset name but something is not quite right, hence the warning message.
Am I missing something?
-- SoundCheck
function setup()
--test = 1 -- sound() works when 'test' left undefined; sound() does not work when 'test' is defined.
if test then
-- assign string to soundFile
soundFile = "asset.downloaded.Game_Sounds_One.Block_1"
print("Warning generated: 'soundFile' was defined in setup() and use attempted in draw().")
print("The text is the same yet something is different.")
else
print("Sound asset is called in draw() and played as expected.")
end
end
function draw()
background(40, 40, 50)
if soundFlg == nil then
if test then
sound(soundFile)
else
sound(asset.downloaded.Game_Sounds_One.Block_1)
end
soundFlg = 1
end
fill(255)
fontSize(20)
if test then
text(soundFile, WIDTH/2, HEIGHT/2+50)
text("This does NOT work.", WIDTH/2, HEIGHT/2)
else
text("This works as expected.", WIDTH/2, HEIGHT/2)
end
end
@Scotty - I think the problem is down to formatting the Sound command, which I use very infrequently. Addressing the sound as a path from a download is the issue - I can see that it works but not sure of the syntax.
The simple code below shows you can flip between inputs with the sound command.
@sim or @jfperusse may be able to clarify better.
viewer.mode = FULLSCREEN
function setup()
--
parameter.integer("soundFlg", 1,2)
end
function draw()
--
background(40, 40, 50)
fill(255)
fontSize(20)
--
if soundFlg == 1 then
sound(SOUND_JUMP, 26329)
elseif soundFlg == 2 then
sound(SOUND_PICKUP, 26329)
end
end
I think the issue is defining soundFile as a string. Remove the quotes to get:
soundFile = asset.downloaded.Game_Sounds_One.Block_1
You’ll also need to change the text call to
text(soundFile.name, WIDTH/2, HEIGHT/2+50)
@west - thanks for that, I missed it.
Thank you for this bit of advice. That solves my problem.
Thanks for helping to solve my problem. Getting an extra set of eyes on the issue was the key. I will apply this solution to my original project and see if that works.
Thanks again.
@Bri_G I appreciate the assistance in solving my problem.
As it turns out, modifying this project so it runs on my iPad Air when it was created using my 3rd gen iPad was a good exercise.
The project has 29 buttons. Each button controls two different sounds, giving me 58 different audio files to manage.
Managing my sound files on iCloud seems way easier than DropBox for some reason.
Converting my project also gave me the opportunity to streamline my variable naming convention. To be fully defined each button required six variables each.
So the upshot is, once again, I learned a great deal from this exercise. And, of course, I appreciate all the assistance you and the other members of this forum have provided.
Thanks again.
@Scotty - great to hear, didn’t realise that sound programming could be so complex - I’ll have to dig into it further when I get time.