Can I import in project any audio file?
I must simulate numeric key pad phone
Gianfranco
I must simulate numeric key pad phone
Gianfranco
Yes. Add the audio files to the Files tab and then use MediaPlayer (or SoundPool) to play the sounds.
Log("File Exists: " & File.Exists(File.DirAssets ,"myfile.ogg"))
S=RTM.AddToMediaStore(File.DirAssets, "myfile.ogg", "Nag", True, True, True, False)
File.Copy(File.DirAssets, "clong.ogg", RTM.GetContentDir, "clong.ogg")
Msgbox( File.DirAssets,"")
Dim Li As List, zzx As Int
Li.Initialize
Li=File.ListFiles(File.DirAssets)
If Li.Size > 0 Then
For zzx=0 To Li.Size - 1
Msgbox(Li.Get(zzx),"")
Next
End If
File.Combine(File.DirRootExternal, "Ringtones")
Combine (Dir As String, FileName As String) As String
"Returns the full path to the given file.
This methods does not support files in the assets folder."
File.DirRootExternal
java.io.FileNotFoundException: /mnt/sdcard/Nag/Ringtones/clong.ogg (Permission denied)
Msgbox ("Ext Dir " & File.DirRootExternal,"")
If File.Exists(File.DirRootExternal, "Nag") = False Then File.MakeDir(File.DirRootExternal, "Nag")
Log("1")
If File.Exists(File.DirRootExternal & "/Nag", "ringtones") = False Then File.MakeDir(File.DirRootExternal & "/Nag", "Ringtones")
B = False
Log("2")
If File.Exists(File.DirRootExternal & "/Nag/Ringtones", "clong.ogg") = False Then
File.Copy(File.DirAssets, "clong.ogg", File.DirRootExternal & "/Nag/Ringtones", "clong.ogg")
B = True
End If
Log("3")
If (File.Exists(File.DirRootExternal & "/Nag/Ringtones", "clong.ogg")) AND (B = True) Then
S = RTM.AddToMediaStore(File.DirRootExternal & "/Nag/Ringtones", "clong.ogg", "Nag", True, True, True, False)
NagMod.smgr.SetString("NagRingtone", S)
Else
NagMod.smgr.SetString("NagRingtone", RTM.GetDefault(RTM.TYPE_NOTIFICATION))
End If