Skip to content

No audioable sound Composition #3078

@muhammad-najam-cmp

Description

@muhammad-najam-cmp

I'm create composition using video inputs, but failing to hear audio, even in transformer

logs for composition created:
16:27:09.986 PREVIEW_LOG E CreatedComposition:{"sequences":[{"mediaItems":[{"mediaItem":{"extension":"mp4","clippingStartMs":0,"clippingEndMs":"13399"},"effects":{"audio":[],"video":["Crop"]},"removeAudio":false,"removeVideo":false,"durationUs":13400000,"presentationDuration":13399000}],"trackTypes":[-2],"isLooping":false}],"effects":{"audio":[],"video":["Presentation"]},"transmuxAudio":false,"transmuxVideo":false,"hdrMode":0,"retainHdrFromUltraHdrImage":false}

it said removeAudio is false.

Moreover, If I attach some audio seperately same setup play audios,
logs with audio-sequence

16:31:58.695 PREVIEW_LOG E CreatedComposition:{"sequences":[{"mediaItems":[{"mediaItem":{"extension":"mp4","clippingStartMs":0,"clippingEndMs":"13399"},"effects":{"audio":[],"video":["Crop"]},"removeAudio":false,"removeVideo":false,"durationUs":13400000,"presentationDuration":13399000}],"trackTypes":[-2],"isLooping":false},{"mediaItems":[{"mediaItem":{"extension":"aac","clippingStartMs":0,"clippingEndMs":"13399"},"effects":{},"removeAudio":false,"removeVideo":false,"durationUs":13399999,"presentationDuration":13399000}],"trackTypes":[-2],"isLooping":true}],"effects":{"audio":[],"video":["Presentation"]},"transmuxAudio":false,"transmuxVideo":false,"hdrMode":0,"retainHdrFromUltraHdrImage":false}

But I want to keep original video audioable.
I'm using media3-1.9.2

In past some older version mighty 1.6.2 it was playing audio of attached EditedMediaItem in composition, while setting

            val pitchChanger = SonicAudioProcessor()
            pitchChanger.setPitch(if (filteredSelectionModels.size % 2 == 0) 2f else 0.2f)

More logs:

 Composition_LOG          E  Composition->0 fileType:Video,cA=true&&eOA=true originalDur:13400000, startTime:0, clipDuration:13399999, endTime:13399,
 Composition_LOG          E  allowing audios
 PREVIEW_LOG                 E  CreatedComposition:{"sequences":[{"mediaItems":[{"mediaItem":{"extension":"mp4","clippingStartMs":0,"clippingEndMs":"13399"},"effects":{"audio":[],"video":["Crop"]},"removeAudio":false,"removeVideo":false,"durationUs":13400000,"presentationDuration":13399000}],"trackTypes":[1,2],"isLooping":false}],"effects":{"audio":[],"video":["Presentation"]},"transmuxAudio":true,"transmuxVideo":true,"hdrMode":0,"retainHdrFromUltraHdrImage":false}
Composition_LOG          E  Player ready: duration=13399ms (13s), state=2, sequences=1
_LOG                  E  New composition player created successfully and started
 _LOG                  E  Recomposing from Top, 1
 PLAYER_LOG               E  Player ready, playWhenReady=true, isPlaying=true
 PLAYER_LOG               E  AUDIO_DIAG: volume=1.0, audioSessionId=0
 PLAYER_LOG               E  AUDIO_DIAG: totalGroups=0, audioGroups=0, videoGroups=0
 PLAYER_LOG               E  AUDIO_DIAG: *** NO AUDIO TRACKS DETECTED BY PLAYER ***

withIn:

 override fun onPlaybackStateChanged(state: Int) {
                   when (state) {
                       Player.STATE_READY -> {
                           uiStateViewModel.isMusicPlaying.value = player.playWhenReady
                           uiStateViewModel.isCreatingComposition.value = false
                           isBufferingCompleted = true
                           log("PLAYER_LOG", "Player ready, playWhenReady=${player.playWhenReady}, isPlaying=${player.isPlaying}")
                           // Audio diagnostics
                           log("PLAYER_LOG", "AUDIO_DIAG: volume=${player.volume}, audioSessionId=${player.audioSessionId}")
                           val tracks = player.currentTracks
                           val audioGroups = tracks.groups.filter { it.type == androidx.media3.common.C.TRACK_TYPE_AUDIO }
                           val videoGroups = tracks.groups.filter { it.type == androidx.media3.common.C.TRACK_TYPE_VIDEO }
                           log("PLAYER_LOG", "AUDIO_DIAG: totalGroups=${tracks.groups.size}, audioGroups=${audioGroups.size}, videoGroups=${videoGroups.size}")
                           audioGroups.forEachIndexed { i, group ->
                               for (j in 0 until group.length) {
                                   val fmt = group.getTrackFormat(j)
                                   log("PLAYER_LOG", "AUDIO_DIAG: audioTrack[$i][$j] mime=${fmt.sampleMimeType} sr=${fmt.sampleRate} ch=${fmt.channelCount} selected=${group.isTrackSelected(j)}")
                               }
                           }
                           if (audioGroups.isEmpty()) {
                               log("PLAYER_LOG", "AUDIO_DIAG: *** NO AUDIO TRACKS DETECTED BY PLAYER ***")
                           }
                       }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions