Skip to content

Conversation

@diazandr3s
Copy link
Contributor

  • Add the button to record a 5-second audio

@diazandr3s
Copy link
Contributor Author

Added the Record Prompt button and mic icon

Screenshot from 2025-02-20 16-00-41

The official 3DSlicer install package on Windows/Linux does not contain the mediaservice plugins and so it is normal to get the error:

[Qt] defaultServiceProvider::requestService(): no service found for - "org.qt-project.qt.audiosource"

This can be fixed by copying all shared libraries from my Qt install folder:

Windows: c:\Qt\5.15.2\msvc2019_64\plugins\mediaservice    
Linux: /usr/lib/x86_64-linux-gnu/qt5/plugins/mediaservice

To the Slicer install tree:

Windows: "c:\Users\andra\AppData\Local\slicer.org\Slicer 5.8.0\lib\QtPlugins\mediaservice"   
Linux: ./Slicer-5.8.0-linux-amd64/

In Linux, you may need to install mediaservice by using the following commands:

sudo apt-get install gstreamer1.0-libav gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly

sudo apt-get install libgstreamer1.0-dev

Currently getting the following error:

[Qt] QMediaRecorder::FormatError : Not compatible codecs and container format.
[Qt] QMediaRecorder::FormatError : Not compatible codecs and container format.
[Qt] Could not create a media muxer element: ""
[Qt] QMediaRecorder::FormatError : Failed to build media capture pipeline.

Screenshot from 2025-02-20 15-52-14

CC: @lassoan

@lassoan
Copy link

lassoan commented Feb 25, 2025

It works well for me on Windows. What operating systems you have tried this on and with what results?

@lassoan
Copy link

lassoan commented Feb 25, 2025

It might also help if you query the list of supported settings:

#include <QMediaRecorder>
#include <QAudioEncoderSettings>

QMediaRecorder *recorder = new QMediaRecorder(yourMediaObject);

QList<QString> supportedCodecs = recorder->supportedAudioCodecs();
QList<int> supportedSampleRates = recorder->supportedAudioSampleRates();
QList<int> supportedBitRates = recorder->supportedAudioBitRates();
QList<int> supportedChannelCounts = recorder->supportedAudioChannels();
QList<QMultimedia::EncodingMode> supportedEncodingModes = recorder->supportedAudioEncodingModes();
```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants