Re: Help with androidStartAudioPlayingInBackground()

2021-03-29 Thread Derek Bump via use-livecode

That did the trick, thank you.

On 3/28/21 2:08 PM, J. Landman Gay via use-livecode wrote:
I've seen similar issues when trying to read other file types from the 
resources folder in an Android standalone. Try copying the file to 
specialFolderPath("documents") and play it from there. It's likely a 
permissions problem that I wish didn't exist.


On 3/28/21 1:24 PM, Derek Bump via use-livecode wrote:

Hello Everyone,

I was wondering if anyone has insight into the usage of 
"androidStartAudioPlayingInBackground()", or can confirm that it works?


I setup a test stack that attempts to play a public domain MP3 using 
the following script but nothing plays. I receive nothing from the 
function, and I'm getting the following in logcat: LiveCode: JNI 
exception thrown when calling native method


on mouseUp
    local tFile
    put specialFolderPath("engine") & "/" & "spring_song.mp3" into tFile
    if there is not a file tFile then
   answer "File not found:" && tFile
    end if
    put androidStartAudioPlayingInBackground(tFile) into card field 
"result"

    -- logcat: LiveCode: JNI exception thrown when calling native method
end mouseUp

I've tested this build using Community 9.6.2 (rc3) and 9.0.5, on an 
Android 9.0 Virtual Device and a Android 9.0 phone. Same result 
across the board, nothing plays.


I did test and confirm the ability to play the audio file with 
"mobilePlaySoundOnChannel", but I need background playback for my 
project to work. Also, I searched the LiveCode Quality Control site 
for existing bugs (no results) and searched the forum a bit.


Does anyone have any ideas? Here is my test stack if you're willing 
to give it a shot on your end: 
https://www.speedbump.io/shared/backgroundPlayTest.minimal.zip


Thank you in advance,

Derek Bump

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Help with androidStartAudioPlayingInBackground()

2021-03-28 Thread Derek Bump via use-livecode

Hello Everyone,

I was wondering if anyone has insight into the usage of 
"androidStartAudioPlayingInBackground()", or can confirm that it works?


I setup a test stack that attempts to play a public domain MP3 using the 
following script but nothing plays. I receive nothing from the function, 
and I'm getting the following in logcat: LiveCode: JNI exception thrown 
when calling native method


on mouseUp
   local tFile
   put specialFolderPath("engine") & "/" & "spring_song.mp3" into tFile
   if there is not a file tFile then
  answer "File not found:" && tFile
   end if
   
   put androidStartAudioPlayingInBackground(tFile) into card field "result"

   -- logcat: LiveCode: JNI exception thrown when calling native method
end mouseUp

I've tested this build using Community 9.6.2 (rc3) and 9.0.5, on an 
Android 9.0 Virtual Device and a Android 9.0 phone. Same result across 
the board, nothing plays.


I did test and confirm the ability to play the audio file with 
"mobilePlaySoundOnChannel", but I need background playback for my 
project to work. Also, I searched the LiveCode Quality Control site for 
existing bugs (no results) and searched the forum a bit.


Does anyone have any ideas? Here is my test stack if you're willing to 
give it a shot on your end: 
https://www.speedbump.io/shared/backgroundPlayTest.minimal.zip


Thank you in advance,

Derek Bump

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Animation Engine: speed tips

2020-06-27 Thread Derek Bump via use-livecode

On 6/27/20 7:09 PM, David Bovill via use-livecode wrote:

I made a quick test - creating and animating small graphic circles along a complex 
curve with many points. It works fine with one or two animated spheres but I’d 
like to be able to animate >30 and it slows to a crawl after 4 or 5. I tried 
setting the layer mode appropriately for all the objects - but I’m doing this on a 
new MacBook Pro - and it does not make a difference.

Does anyone have an example stack with multiple animated objects that I can 
compare / test for speed?


Hello David,

You're welcome to play around with my sketchbook: 
https://speedbump.io/shared/yage-sketchbook.zip


Ignore the first card, as it's my misunderstanding of how to effectively 
use Animation Engine, but the 2nd card uses the movePolygonal command to 
animate 60 objects across several polygons at about 60FPS on my Ryzen 
3700X on Linux Mint 19.3.


Frame rate jumps a tad on Windows, but I don't have a Mac to test with 
anymore.


Would you be willing to share your stack?

--
Derek Bump

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Experiments with the container layerMode and Animation Engine

2019-08-09 Thread Derek Bump via use-livecode

Hello List,

I hope all of you have been well. It's been a while since I've 
experimented with Animation Engine--or LiveCode in general--and the 
recent addition of the "container" layerMode in 9.5 had me thinking that 
it might be a good time to revisit animation and gaming. However, I've 
been rooted in the world of LAMPP stacks for the past decade and my 
grasp of math-heavy concepts is pretty bad.


So with that in mind, I was hoping I could get some feedback on my 
scrapbook? I have two different machines that I've been testing on and 
the results have been pretty interesting. Especially on the Linux side, 
which is where I saw the fastest rendering. I assumed that Windows would 
have had a commanding lead, but rendering with Linux on the same 
hardware was nearly twice as fast. Which makes me suspicious I may have 
overlooked something.


https://speedbump.io/shared/yage/YAGE_Sketchbook_v1.zip (37.4 MB)
https://speedbump.io/shared/yage/YAGE_Sketchbook_v1_without_builds.zip 
(134.2 KB)


Platform binaries are located in ./builds, Windowed at 1024 x 576 pixels...

4 cores, 4 Threads @3.2 GHz, i5-4570 (2013)

    Linux Mint 19.1
        Random Movement 1x1: 85-95 fps
        Polygonal: 68-90 fps

    Windows 10
        Random Movement 1x1: 37-41 fps
        Polygonal:29-41 fps

4 cores, 8 Threads @2.3 GHz, i7-3615QM (2013)

    macOS 10.14.5
        Random Movement 1x1: 12-15 fps
        Polygonal: 15-25 fps

One suspicion in particular is whether my implementation of Animation 
Engine is efficient or not? My sketches are largely just a continuous 
loop, but I know my rendering will decline significantly once I start 
adding more logic, collisions, media, and anything else I've overlooked. 
I'm still making my way through the documentation though.


My plans for the future are some mini-games in a simplified style. 
Top-down racing with basic collision detection, maybe a fishing game, or 
something even more basic like skydiving into rings. To be honest, I get 
most of my ideas from the mini-games my spouse loves to play so I'll 
probably glean a few since I have a live-in play tester. Gotta be 
careful with that. ;-)


So anyways, I'm looking forward to hearing what you folks have to say.

I hope everyone has a great weekend. Cheers!

--

Derek Bump
Henderson, NV


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode