diff --git a/QQt.pro b/QQt.pro index 2a4924b9..4ccdd419 100644 --- a/QQt.pro +++ b/QQt.pro @@ -19,7 +19,8 @@ SUBDIRS = src/qqt.pro ##QQt installed to sdk or ##QQt is build ##----------------------------------------------------------------- -#SUBDIRS += examples/exquisite +# +SUBDIRS += examples/exquisite #SUBDIRS += examples/tabwidgetexamples #SUBDIRS += examples/qrcodeexample #SUBDIRS += examples/qqtnetworkexample diff --git a/src/multimedia/qqtaudiomanager.h b/src/multimedia/qqtaudiomanager.h index 7294f94f..4068122d 100644 --- a/src/multimedia/qqtaudiomanager.h +++ b/src/multimedia/qqtaudiomanager.h @@ -45,6 +45,8 @@ * 算一算: * 高保真肯定是用最高的采样率48000, 量化精度16位(2字节), 立体声2声道. 一首歌通常200秒 * 48000 * 2 * 2 * 200 = 38400000字节, 大概38M一首歌曲 + * + * ****由于Qt 实现上的原因,暂时仅仅支持桌面。在安卓上在关闭时会崩溃**** **/ class QQTSHARED_EXPORT QQtAudioManager : public QObject { diff --git a/test/voicetest/android/AndroidManifest.xml b/test/voicetest/android/AndroidManifest.xml new file mode 100644 index 00000000..a4f93c44 --- /dev/null +++ b/test/voicetest/android/AndroidManifest.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/voicetest/android/res/drawable-hdpi/ic_launcher.png b/test/voicetest/android/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 00000000..445bb11b Binary files /dev/null and b/test/voicetest/android/res/drawable-hdpi/ic_launcher.png differ diff --git a/test/voicetest/android/res/drawable-hdpi/icon.png b/test/voicetest/android/res/drawable-hdpi/icon.png new file mode 100644 index 00000000..e1aadcbd Binary files /dev/null and b/test/voicetest/android/res/drawable-hdpi/icon.png differ diff --git a/test/voicetest/android/res/drawable-ldpi/ic_launcher.png b/test/voicetest/android/res/drawable-ldpi/ic_launcher.png new file mode 100644 index 00000000..cb129452 Binary files /dev/null and b/test/voicetest/android/res/drawable-ldpi/ic_launcher.png differ diff --git a/test/voicetest/android/res/drawable-ldpi/icon.png b/test/voicetest/android/res/drawable-ldpi/icon.png new file mode 100644 index 00000000..3eaa29bd Binary files /dev/null and b/test/voicetest/android/res/drawable-ldpi/icon.png differ diff --git a/test/voicetest/android/res/drawable-mdpi/ic_launcher.png b/test/voicetest/android/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 00000000..15876f47 Binary files /dev/null and b/test/voicetest/android/res/drawable-mdpi/ic_launcher.png differ diff --git a/test/voicetest/android/res/drawable-mdpi/icon.png b/test/voicetest/android/res/drawable-mdpi/icon.png new file mode 100644 index 00000000..f35a8cb2 Binary files /dev/null and b/test/voicetest/android/res/drawable-mdpi/icon.png differ diff --git a/test/voicetest/android/res/drawable-xhdpi/ic_launcher.png b/test/voicetest/android/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 00000000..3eaa29bd Binary files /dev/null and b/test/voicetest/android/res/drawable-xhdpi/ic_launcher.png differ diff --git a/test/voicetest/android/res/drawable-xxhdpi/ic_launcher.png b/test/voicetest/android/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..f35a8cb2 Binary files /dev/null and b/test/voicetest/android/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/test/voicetest/android/res/drawable-xxxhdpi/ic_launcher.png b/test/voicetest/android/res/drawable-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..e1aadcbd Binary files /dev/null and b/test/voicetest/android/res/drawable-xxxhdpi/ic_launcher.png differ diff --git a/test/voicetest/main.cpp b/test/voicetest/main.cpp index b48f94ec..2e54b246 100644 --- a/test/voicetest/main.cpp +++ b/test/voicetest/main.cpp @@ -1,11 +1,15 @@ -#include "mainwindow.h" +#include "mainwindow.h" #include +#include +#include -int main(int argc, char *argv[]) +int main ( int argc, char* argv[] ) { - QApplication a(argc, argv); + QQtApplication a ( argc, argv ); + MainWindow w; w.show(); + moveFull ( &w ); return a.exec(); } diff --git a/test/voicetest/mainwindow.cpp b/test/voicetest/mainwindow.cpp index 1f714a72..961c7042 100644 --- a/test/voicetest/mainwindow.cpp +++ b/test/voicetest/mainwindow.cpp @@ -284,12 +284,12 @@ void MainWindow::on_pushButton_clicked() pline() << "in prefer" << dev.preferredFormat().channelCount() << dev.preferredFormat().sampleRate() << dev.preferredFormat().sampleSize(); - pline() << "in" << manager.inputAudioFormat().channelCount() << manager.inputAudioFormat().sampleRate() << - manager.inputAudioFormat().sampleSize(); - pline() << "out prefer" << devOut.preferredFormat().channelCount() << devOut.preferredFormat().sampleRate() << devOut.preferredFormat().sampleSize(); + pline() << "in" << manager.inputAudioFormat().channelCount() << manager.inputAudioFormat().sampleRate() << + manager.inputAudioFormat().sampleSize(); + pline() << "out" << manager.outputAudioFormat().channelCount() << manager.outputAudioFormat().sampleRate() << manager.outputAudioFormat().sampleSize(); @@ -313,8 +313,8 @@ void MainWindow::readyRead() void MainWindow::on_pushButton_3_clicked() { - manager.stopOutput(); manager.stopInput(); + manager.stopOutput(); } /*bug:Qt 设置音量会报错退出*/ @@ -351,6 +351,20 @@ void MainWindow::on_pushButton_4_clicked() manager.inputAudioFormat() = QQtAudioManager::defaultOutputDevice().preferredFormat(); manager.outputAudioFormat() = QQtAudioManager::defaultOutputDevice().preferredFormat(); + pline() << "in prefer" << QQtAudioManager::defaultInputDevice().preferredFormat().channelCount() << + QQtAudioManager::defaultInputDevice().preferredFormat().sampleRate() << + QQtAudioManager::defaultInputDevice().preferredFormat().sampleSize(); + + pline() << "out prefer" << QQtAudioManager::defaultOutputDevice().preferredFormat().channelCount() << + QQtAudioManager::defaultOutputDevice().preferredFormat().sampleRate() << + QQtAudioManager::defaultOutputDevice().preferredFormat().sampleSize(); + + pline() << "in" << manager.inputAudioFormat().channelCount() << manager.inputAudioFormat().sampleRate() << + manager.inputAudioFormat().sampleSize(); + + pline() << "out" << manager.outputAudioFormat().channelCount() << manager.outputAudioFormat().sampleRate() << + manager.outputAudioFormat().sampleSize(); + manager.startDefaultInput(); manager.startDefaultOutput(); } diff --git a/test/voicetest/mainwindow.ui b/test/voicetest/mainwindow.ui index 82aac316..77f14363 100644 --- a/test/voicetest/mainwindow.ui +++ b/test/voicetest/mainwindow.ui @@ -6,182 +6,140 @@ 0 0 - 1198 - 591 + 932 + 451 MainWindow - - - - 300 - 20 - 262 - 551 - - - - - - - - - - - - - - - - - - - output format - - - - - - - output device - - - - - - - - - 610 - 40 - 181 - 32 - - - - start take voice and play - - - - - - 610 - 200 - 181 - 32 - - - - refresh device list - - - - - - 610 - 90 - 181 - 32 - - - - stop (optional) - - - - - - 820 - 40 - 291 - 32 - - - - start take voice and play (default device) - - - - - - 20 - 20 - 258 - 551 - - - - - - - - - - - - - - - - - - - input format - - - - - - - input device - - - - - - - - - 620 - 280 - 161 - 101 - - - - - - - input volume - - - - - - - Qt::Horizontal - - - - - - - output volume - - - - - - - Qt::Horizontal - - - - - + + + + + + + input volume + + + + + + + Qt::Horizontal + + + + + + + output volume + + + + + + + Qt::Horizontal + + + + + + + + + start take voice and play + + + + + + + stop (optional) + + + + + + + refresh device list + + + + + + + + + + + + + + + + + + + + + + + + output format + + + + + + + output device + + + + + + + + + + + + + + + + + + + + + + + input format + + + + + + + input device + + + + + + + + + start take voice +and play (default device) + + + + diff --git a/test/voicetest/voicetest.pro b/test/voicetest/voicetest.pro index 3a423729..218b822f 100644 --- a/test/voicetest/voicetest.pro +++ b/test/voicetest/voicetest.pro @@ -36,4 +36,16 @@ FORMS += \ CONFIG += mobility MOBILITY = +#这句话很重要 启动拷贝很多东西 +system (touch main.cpp) + include (../../src/app_base_manager.pri) + +contains(QKIT_PRIVATE, ANDROID|ANDROIDX86) { + CONFIG += mobility + MOBILITY = + DISTFILES += \ + $${PWD}/android/AndroidManifest.xml + + ANDROID_PACKAGE_SOURCE_DIR = $${PWD}/android +}