Hi all,
Before I start, I'd like to thank anyone who cares to offere any solutions to this one..
I Just built a tap app that plays a random MP3 file (phrase) everytime the button is pressed.
Simple app design based loosely off Pauls Playground 1st app video
The issue is, i ported to xCode and then installed the app on my iPhone 12 for final test. Upon tapping the button (trigger point) no sound comes from the phones speakers. But, if I plug in headphones, I can hear it perfectly and it works as intended.
Does this mean the Subsonic audio package only works for headphones? If so, has it, or will it be updated for phone speaker sound?
Again, thanks for any advice offered.
Oh, and before anyone asks. No, the phone is not in silent mode or volume turned down. ;-)
Here is the code...
import SwiftUI
import Subsonic
struct ContentView: View {
func choose() {
_ = Int.random(in: 1..<31)
}
// var snd = Int.random(in: 1..<31)
var body: some View {
ZStack{
Color.white.edgesIgnoringSafeArea(.all)
// Stick buttong code here to call random & play func()
Button {
stopAllManagedSounds()
let snd = Int.random(in: 1..<31)
play(sound: "\(snd).mp3")
} label: {
Image("ButtonOn")
.resizable()
.scaledToFit()
}
}
} }