I have a strange bug in my software that crashes either the livecode ide version of my app or the macOS standalone. The same line of code will run successfully for an average of around 200 times without issue then the next time that line runs the code crashes. It does not appear to be about the accumulation of some problem because it might crash after 20 and it might take till 400 or more. The action being dealt with is simple and consistent - setting the filename of a player object.
I wonder if anyone here is familiar with this situation?
line of code: set the filename of player "audio" of me to tFile
tFile was calculated about 4 lines earlier and since it was calculated I have written to a log file 3 times so I don't think adding a "wait 10 milliseconds" is going to help this time though it has helped in the past with other situations.
I've checked that the tFile address is correct - which it is. I've checked that the audio file it is calling is present and named correctly. It is. What I don't know is if it happens on playing the same files (chosen at random and just started investigating that) but I doubt it since the file it most recently crashed on is in perfect working order.
update: last 3 crashes have all been the line above, all with different audio files
I think I'm correct in saying that with macOS you have to use a player rather than just play the file (AAC) directly.
LC: 10.0.0 - DP 7
macOS: Sonoma 14.2.1
macmini2 - M1
Driving me nuts!
The programme does not get as far as playing the audio file. It is the action of setting the filename that crashes it, something I would have thought was innocent enough. When it crashes, it will have had the previous filename present, so it isn't being blank that is causing trouble.
code is below. As you can see my log gets the filename of the player and I can see that that name is correct and the file exists at that address etc. etc.
if the platform = "macOS" then
set the filename of player "audio" of me to tFile -- tFile calculated 4 lines ago
fileAddLine "log", "practice" && n() && the filename of player "audio" of me -- n() gets the line number
wait 10 milliseconds
start player "audio" of me
fileAddLine "log", "practice" && n() && the number of lines in pendingMessages()
end if
update2: I've increased the wait time to 30 milliseconds; no benefit.
I have tried opening the file directly from the filing system using quicktime player. It is perfectly happy to play it.
I wonder if anyone here is familiar with this situation?
line of code: set the filename of player "audio" of me to tFile
tFile was calculated about 4 lines earlier and since it was calculated I have written to a log file 3 times so I don't think adding a "wait 10 milliseconds" is going to help this time though it has helped in the past with other situations.
I've checked that the tFile address is correct - which it is. I've checked that the audio file it is calling is present and named correctly. It is. What I don't know is if it happens on playing the same files (chosen at random and just started investigating that) but I doubt it since the file it most recently crashed on is in perfect working order.
update: last 3 crashes have all been the line above, all with different audio files
I think I'm correct in saying that with macOS you have to use a player rather than just play the file (AAC) directly.
LC: 10.0.0 - DP 7
macOS: Sonoma 14.2.1
macmini2 - M1
Driving me nuts!
The programme does not get as far as playing the audio file. It is the action of setting the filename that crashes it, something I would have thought was innocent enough. When it crashes, it will have had the previous filename present, so it isn't being blank that is causing trouble.
code is below. As you can see my log gets the filename of the player and I can see that that name is correct and the file exists at that address etc. etc.
if the platform = "macOS" then
set the filename of player "audio" of me to tFile -- tFile calculated 4 lines ago
fileAddLine "log", "practice" && n() && the filename of player "audio" of me -- n() gets the line number
wait 10 milliseconds
start player "audio" of me
fileAddLine "log", "practice" && n() && the number of lines in pendingMessages()
end if
update2: I've increased the wait time to 30 milliseconds; no benefit.
I have tried opening the file directly from the filing system using quicktime player. It is perfectly happy to play it.
Statistics: Posted by bbalmerTotalFluency — Sat Jul 06, 2024 2:24 am