apivideo/api.video-reactnative-live-stream

audiosamplerate not included on iOS

daveisfera opened this issue · 11 comments

Describe the bug
The onMetaData from iOS has audiodatarate but not audiosamplerate (using the info parsed in #47 )

To Reproduce
Steps to reproduce the behavior:

  1. Send video with iOS
  2. Parse onMetaData message
  3. Observe audiodatarate is included but audiosamplerate is not

Expected behavior
audiosamplerate is also included with audiodatarate

Smartphone (please complete the following information):

  • Device: iPhone 14 Pro Max
  • OS: 16.1.2
  • Browser: Safari
  • Version: 16.1

Additional context
Knowing the sample rate of the audio allows proper handling of the audio stream that's coming in

Hi,
Yes you are right: see https://github.com/shogo4405/HaishinKit.swift/blob/ca2505a06762da5909d865b796f77c8e27cfdcc5/Sources/RTMP/RTMPStream.swift#L440

Could you add a direct issue there?

Are you aware that you can also find this information in the AudioTagHeader (it is called SoundRate)?

Opened an issue with upstream

Can HaishinKit be upgraded to 1.4.0 to get this fix?

Hi,

Could you check that the main branch does fix the issue?

I just tried installing the updated version by pointing at this repo, but I'm getting this error:

[!] CocoaPods could not find compatible versions for pod "ApiVideoLiveStream":
  In Podfile:
    react-native-live-stream (from `../node_modules/@api.video/react-native-livestream`) was resolved to 1.2.1, which depends on
      ApiVideoLiveStream (= 1.3.1)

None of your spec sources contain a spec satisfying the dependency: `ApiVideoLiveStream (= 1.3.1)`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

@daveisfera Did you try with pod install --repo-update? If this still doesn't help, you can delete Pods and Podfile.lock and re-create pods.

I got that installed and audiosamplerate is now included, but it's 0 so that's incorrect and problematic. I assume that's an issue to check with the lower level module, right?

Indeed it is an issue with HaishinKit. I could made a workaround but I am afraid of the side effects as it may changes sample rate on devices that does not support it.
The next release might not fix this issue.

I push new HaishinKit version to the main branch.
Could you check it is fixed?

Hi,

With latest 1.2.4, this issue should be solved.
Please reopen the issue if it is not the case.

I verified that this works. Thanks for getting it out there!