daniulive / SmarterStreaming

业内为数不多致力于极致体验的超强全自研跨平台(windows/linux/android/iOS)流媒体内核,通过模块化自由组合,支持实时RTMP推流、RTSP推流、RTMP播放器、RTSP播放器、录像、多路流媒体转发、音视频导播、动态视频合成、音频混音、直播互动、内置轻量级RTSP服务等,比快更快,业界真正靠谱的超低延迟直播SDK(1秒内,低延迟模式下150~300ms)。
https://www.daniusdk.com
10.94k stars 2.76k forks source link

CMSampleBufferRef App Audio Noise #59

Closed agmoElle closed 5 years ago

agmoElle commented 6 years ago

Hi,

When I try to stream app audio via ReplayKit, I hear nothing but noise on the feed, but when I save the buffer stream into an audio file, the audio sounds fine. Could this be due to audio encoding?

I use the following method after getting the sampleBuffer from processSampleBuffer callback by ReplayKit.

-(NSInteger) SmartPublisherPostAudioSampleBuffer:(CMSampleBufferRef)data inputType:(NSInteger)inputType;

Want to know that after I pass the data into the method, is the audio data sent as AAC or as PCM?

Thank you.

daniulive commented 6 years ago

Hi,

The interface of "SmartPublisherPostAudioSampleBuffer" post no-encoded audio data(PCM).

BRs.

daniulive commented 6 years ago

Also please make sure the publisher side is a little far away from player side, so that it could avoid the noise.

agmoElle commented 6 years ago

Thanks for the response. Hmm, the distance doesn't seem to be affecting the noise, no matter how far I am away from the player side, the noise still persists.

daniulive commented 6 years ago

Does it possible to record the mp4 file with our app(need to integrate SmartiOSPublisherV2 record related code).

agmoElle commented 6 years ago

Hi,

Uh, am trying to record but using the Publisher sample, but I cant seem to find the place to use the app audio instead of mic audio. Is it possible to record app audio instead of mic audio?

daniulive commented 6 years ago

the audio capture depends on the mode setting, if only publish app only, it could record app audio, otherwise it will record mic audio with background mode.