Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-99893

QAudioSink::start does not play sound if called from its stateChanged signal handler on MacOS and iOS

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P2: Important P2: Important
    • None
    • 6.2.2
    • Multimedia
    • None
    • iOS/tvOS/watchOS, macOS

      I attached the sources of a console app that plays a wav sound specified as an argument, see SoundTest.zip.

      It connects to QAudioSink::stateChanged signal, calls QAudioSink::start and when it receives QAudio::IdleState it calls QAudioSink::start again.

      On Windows and Android this results in an infinite loop, but on MacOS and iOS it is not, but the sound is played only once.

      In my real-life app (not in the example) something goes wrong after an attempt to loop a sound in this way on MacOS/iOS and other sounds stops playing.

      I tried to call QAudioSink::start with QTimer::singleShot, but it did not help.

      Is this a bug or something that is not supported or probably used in a wrong way?

      I also attached a wav sound, so the app can be started as

      SoundTest sound.wav
      

        1. Screenshot 2022-10-09 at 23.56.56.png
          538 kB
          Dmitry Efimov
        2. sound.wav
          590 kB
          Dmitry Efimov
        3. SoundTest.zip
          4 kB
          Dmitry Efimov
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            tpochep Timur Pocheptsov
            dmitriano Dmitry Efimov
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes