zmxv / react-native-sound

React Native module for playing sound clips
MIT License
2.79k stars 748 forks source link

Support for playing .ogg file on iOS devices? #590

Open GuoMeng6 opened 5 years ago

GuoMeng6 commented 5 years ago

When I play the ogg file, it plays fine on Android devices, but it is error when running on iOS devices.

error message:

code: "ENSOSSTATUSERRORDOMAIN1954115647"
domain: "NSOSStatusErrorDomain"
message: "The operation couldn’t be completed. (OSStatus error 1954115647.)"
nativeStackIOS: Array(17)
0: "0   NewProjectDemo                      0x00000001053521b7 RCTJSErrorFromCodeMessageAndNSError + 135"
1: "1   NewProjectDemo                      0x00000001053520e3 RCTJSErrorFromNSError + 275"
2: "2   NewProjectDemo                      0x00000001055958a4 -[RNSound prepare:withKey:withOptions:withCallback:] + 1972"
3: "3   CoreFoundation                      0x000000010952b4cc __invoking___ + 140"
4: "4   CoreFoundation                      0x0000000109528a45 -[NSInvocation invoke] + 325"
5: "5   CoreFoundation                      0x0000000109528e96 -[NSInvocation invokeWithTarget:] + 54"
6: "6   NewProjectDemo                      0x00000001052f633a -[RCTModuleMethod invokeWithBridge:module:arguments:] + 2810"
7: "7   NewProjectDemo                      0x0000000105393e46 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 790"
8: "8   NewProjectDemo                      0x0000000105393953 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 131"
9: "9   NewProjectDemo                      0x00000001053938c9 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 25"
10: "10  libdispatch.dylib                   0x000000010c055d7f _dispatch_call_block_and_release + 12"
11: "11  libdispatch.dylib                   0x000000010c056db5 _dispatch_client_callout + 8"
12: "12  libdispatch.dylib                   0x000000010c05e225 _dispatch_lane_serial_drain + 778"
13: "13  libdispatch.dylib                   0x000000010c05ee9c _dispatch_lane_invoke + 425"
14: "14  libdispatch.dylib                   0x000000010c068ea3 _dispatch_workloop_worker_thread + 733"
15: "15  libsystem_pthread.dylib             0x000000010c43f611 _pthread_wqthread + 421"
16: "16  libsystem_pthread.dylib             0x000000010c43f3fd start_wqthread + 13"
vitorverasm commented 4 years ago

Please

aliunco commented 4 years ago

Yeah, ogg files are really optimized in file size and are really useful in applications, So I would be really happy if I find out that this library supports the ogg files in iOS devices too.

QuocNguyen0909 commented 2 years ago

I have same issue when i play mpga file. it plays fine on Android devices, but it is error when running on iOS devices.

acopetkovic commented 2 years ago

Is this solved?

doronpr commented 2 years ago

Hey guys I wrote a react-native decoder to solve this: https://github.com/wix-incubator/react-native-opus-decode Enjoy :)

berkayakin commented 2 years ago

Hi @doronpr, I can not build the app on an M1 Macbook Pro, when I use your library. I get a huge amount of logs but basically the error is:

/node_modules/react-native-opus-decode/ios/Ogg.framework/Ogg(framing.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/berkayakin/Desktop/dev/InboxMobileReactNative/node_modules/react-native-opus-decode/ios/Ogg.framework/Ogg' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)