diff --git a/trunk/doc/CHANGELOG.md b/trunk/doc/CHANGELOG.md index b17b245de..9be489f06 100644 --- a/trunk/doc/CHANGELOG.md +++ b/trunk/doc/CHANGELOG.md @@ -7,6 +7,7 @@ The changelog for SRS. ## SRS 7.0 Changelog +* v7.0, 2025-10-29, AI: AAC: Fix mono audio reported as stereo in HTTP API. v7.0.112 (#3556) * v7.0, 2025-10-27, HLS/DASH: Fix dispose to skip unpublish when not enabled, and add forbidden directory protection to SrsPath::unlink. v7.0.111 * v7.0, 2025-10-27, AI: HTTP-FLV: Enforce minimum 10ms sleep to prevent CPU busy-wait when mw_latency=0. v7.0.110 (#3963) * v7.0, 2025-10-26, AI: Edge: Fix stream names with dots being incorrectly truncated in source URL generation. v7.0.109 (#4011) diff --git a/trunk/research/players/js/srs.sdk.js b/trunk/research/players/js/srs.sdk.js index 34673c948..32fc69de9 100644 --- a/trunk/research/players/js/srs.sdk.js +++ b/trunk/research/players/js/srs.sdk.js @@ -24,7 +24,9 @@ function SrsRtcWhipWhepAsync() { self.constraints = { audio: true, video: { - width: {ideal: 320, max: 576} + width: {ideal: 320, max: 720}, + //width: {ideal: 720, max: 1080}, + //width: 1280, height: 720, frameRate: 30, } }; diff --git a/trunk/src/app/srs_app_rtmp_source.cpp b/trunk/src/app/srs_app_rtmp_source.cpp index d6da4a162..96cd411e5 100644 --- a/trunk/src/app/srs_app_rtmp_source.cpp +++ b/trunk/src/app/srs_app_rtmp_source.cpp @@ -1008,7 +1008,17 @@ srs_error_t SrsOriginHub::on_audio(SrsMediaPacket *shared_audio) sample_rate = srs_audio_sample_rate_from_number(srs_aac_srates[c->aac_sample_rate_]); } - if ((err = stat_->on_audio_info(req_, format->acodec_->id_, sample_rate, c->sound_type_, c->aac_object_)) != srs_success) { + // For AAC, use aac_channels_ from AudioSpecificConfig instead of sound_type_ from FLV tag. + // The FLV sound_type field is often incorrect for AAC streams (e.g., FFmpeg sets it to stereo + // even for mono streams). The AAC AudioSpecificConfig channelConfiguration is the authoritative + // source: 1=mono, 2=stereo. Map to SrsAudioChannels: 0=mono, 1=stereo. + // For MP3 and other codecs, use sound_type_ from FLV tag. + SrsAudioChannels channels = c->sound_type_; + if (format->acodec_->id_ == SrsAudioCodecIdAAC) { + channels = (c->aac_channels_ == 1) ? SrsAudioChannelsMono : SrsAudioChannelsStereo; + } + + if ((err = stat_->on_audio_info(req_, format->acodec_->id_, sample_rate, channels, c->aac_object_)) != srs_success) { return srs_error_wrap(err, "stat audio"); } diff --git a/trunk/src/core/srs_core_version7.hpp b/trunk/src/core/srs_core_version7.hpp index 66d4422ac..f1801d3be 100644 --- a/trunk/src/core/srs_core_version7.hpp +++ b/trunk/src/core/srs_core_version7.hpp @@ -9,6 +9,6 @@ #define VERSION_MAJOR 7 #define VERSION_MINOR 0 -#define VERSION_REVISION 111 +#define VERSION_REVISION 112 #endif \ No newline at end of file