Is it possible to play an audio at certain position?
I mean I would like to have different sounds effects in the same audio file. and then play diferent parts of it?
Is there a function or documented function for that?
Something like…
audio.play('soundid,timeposition,duration)
https://coronalabs.com/blog/2011/07/27/the-secretundocumented-audio-apis-in-corona-sdk/
read the disclaimer
I’d like to double-down on the disclaimer. This blog post was written in 2011 back in the day of iOS 5 and 6. iOS has changed a lot since then and we have not made a single update to these features and we have no plans to. They may or may not work. If they do work now, they may not work in the future.
Feel free to experiment with them but there is no support for them.
Rob
I have read that post, and i have used those tricks sometimes, but I don’t see if there is a way to play a sound at certain position…i don’t mean 3d sound(x,y,z)…I mean play a sound for example in the 3th second of the audio during 1 second…So I could have lot of audios in one single file and play them specifying a starting point and duration. I think is a good way to save resources, not having to load and unload sounds. Like a sprites of sounds.
Audio 0s 1s 2s 3s 4s
| play(starting here)
I’m not sure if you can do that, but the concept is called seek.
Note: The PDF link from that article was broken, but here is an alternate: https://www.openal.org/documentation/OpenAL_Programmers_Guide.pdf
Unfortunately I don’t see anything about seeking in the doc.
In C it would look like this:
alGetBufferi(buffer, AL\_SIZE, &tot); alSourcei(source, AL\_BYTE\_OFFSET, seek\*tot); alSourcePlay(source); //let's play
You’ll be looking to do something like this via the Lua interface.
Thank you so much for the path to follow. I will try
https://coronalabs.com/blog/2011/07/27/the-secretundocumented-audio-apis-in-corona-sdk/
read the disclaimer
I’d like to double-down on the disclaimer. This blog post was written in 2011 back in the day of iOS 5 and 6. iOS has changed a lot since then and we have not made a single update to these features and we have no plans to. They may or may not work. If they do work now, they may not work in the future.
Feel free to experiment with them but there is no support for them.
Rob
I have read that post, and i have used those tricks sometimes, but I don’t see if there is a way to play a sound at certain position…i don’t mean 3d sound(x,y,z)…I mean play a sound for example in the 3th second of the audio during 1 second…So I could have lot of audios in one single file and play them specifying a starting point and duration. I think is a good way to save resources, not having to load and unload sounds. Like a sprites of sounds.
Audio 0s 1s 2s 3s 4s
| play(starting here)
I’m not sure if you can do that, but the concept is called seek.
Note: The PDF link from that article was broken, but here is an alternate: https://www.openal.org/documentation/OpenAL_Programmers_Guide.pdf
Unfortunately I don’t see anything about seeking in the doc.
In C it would look like this:
alGetBufferi(buffer, AL\_SIZE, &tot); alSourcei(source, AL\_BYTE\_OFFSET, seek\*tot); alSourcePlay(source); //let's play
You’ll be looking to do something like this via the Lua interface.
Thank you so much for the path to follow. I will try