How create android app mp3 player

Just starting out? Need help? Post your questions and find answers here.
acreis
Posts: 1
Joined: Sat May 25, 2024 8:20 am

How create android app mp3 player

Post by acreis »

Good Morning


Is it possible, using SpiderBasic to create an Android app, to be deployed to an automobile device (android car radio) that reads removable storage in USB ports and plays music in MP3 format .

Thanks!
User avatar
Caronte3D
Posts: 189
Joined: Sat Nov 23, 2019 5:21 pm
Location: Some Universe

Re: How create android app mp3 player

Post by Caronte3D »

With PlaySound() you can play any audio file, if the browser support it, maybe on Android app is the same.

I only tested it on Windows (Chrome):

Code: Select all

  InitSound()
  
  Procedure Loading(Type, Filename$, ObjectId)
    Debug Filename$ + " loaded (id = " + ObjectId + ")"
  EndProcedure
    
  Procedure LoadingError(Type, Filename$)
    Debug Filename$ + ": loading error"
  EndProcedure
  
  Procedure MyPlay()
    PlaySound(1) ; play the sound
    Debug "Playing..."
  EndProcedure
  
  OpenWindow(0, 0, 0, 200, 200, "Player", #PB_Window_SystemMenu | #PB_Window_SystemMenu)
  ButtonGadget(2,75,75,50,50,"PLAY")
  
  BindEvent(#PB_Event_Loading, @Loading())
  BindEvent(#PB_Event_LoadingError, @LoadingError())
  BindEvent(#PB_Event_Gadget, @MyPlay(),0,2)
  
  
  LoadSound(1, "Free_Test_Data_100KB_MP3.mp3")
Post Reply