Giter VIP home page Giter VIP logo

azkadev / whisper_dart Goto Github PK

View Code? Open in Web Editor NEW
459.0 12.0 29.0 60.02 MB

Whisper Dart is a cross platform library for dart and flutter that allows converting audio to text / speech to text / inference from Open AI models

License: Other

Dart 3.95% C++ 95.96% CMake 0.04% Makefile 0.05%
dart flutter speech-to-text whisper whisper-dart transcribe openai transformer speech speech-recognition speech-synthesis ai whisper-flutter android indonesia ios linux macos windows ggml

whisper_dart's Introduction

Whisper

Whisper is an open source project from openai to extract text from sound, this project uses whisper.cpp, And use FFMPEG To convert audio to WAV, this project can be run on the client side and server side and does not require internet.

Information

Sorry, my internet is currently very limited, if there are many people who donate stable $ 50 dollars / per month, I will immediately update this library while simplifying and increasing the documentation

Status

18-April-2024 - and now

Currently the library is being revised and changing the code style, this is being done to make it friendly/easy to use for everyone

Demo

  1. Flutter App
2023-02-23.01-19-43.mp4

NEED More Update And More Features?

Indonesia: jika anda ingin saya maintance terus project ini silahkan donate ke saya
English: if you want me to continue to maintain this project please donate to me

Resources

  1. Datasets Whisper GGML

Memory Usage

Model Disk Mem
tiny 75 MB 125 MB
base 142 MB 210 MB
small 466 MB 600 MB
medium 1.5 GB 1.7 GB
large 2.9 GB 3.3 GB

Roadmap Features

Features yang akan datang

  1. Cross Platform (Android / linux / windows / ios / macos)
  2. Add FFMPEG KIT Cross Platform (Android / linux / windows / ios / macos)
  3. Docs
  4. Pretty Use Library / Simple

TESTED ON

NO OS CPU RAM
1 Ubuntu 20.04 AMD RYZEN 5500U 8GB
2 Ubuntu 23.10 AMD RYZEN 5500U 16GB
3 Android 14 Snapdragon 665 3GB
4 Android 11 Snapdragon 665 3GB
5 Android 5 Snapdragon 430 2GB
6 Windows 11 Pro 22H2 (22621.1105) AMD RYZEN 3600 16GB
7 Android 13 Snapdragon 730 4GB
8 Pixel 3a API 33 AndroiD x64 emulator Unknown Unknown

Quickstart

  1. Dart

If you want to use whisper in your cli / backend server use this

  • Install Package First
dart pub add whisper_dart
  • Add library
import "package:whisper_dart/whisper_dart.dart";
  1. Flutter app

If you want to use whisper in your app use this

  • Install Package First
flutter pub add whisper_flutter
  • add library
import "package:whisper_flutter/whisper_flutter.dart";

Docs

  1. Github Docs
  2. Support Group
  3. Youtube

Quickstart

Whisper whisper = Whisper();
var res = await whisper.request( 
    whisperRequest: WhisperRequest.fromWavFile(
        audio: File(audio),
        model: File(model),
    ),
);

Reference

  1. Whisper.cpp

Contributors

  1. JeisonSanches - Whisper Flutter

Global Corporation

Welcome to Global Corporation profile!  

Instagram       Twitter       Twitter       Youtube      

Global Corporation Is a leading company that takes a leading role in accelerating and maintaining enterprise security.

With a sharp focus on innovation and technological excellence

Global Corporation providing effective proactive solutions to secure company operations and prevent potential adverse risks.

With a committed team of experts, advanced technology, and a holistic approach to corporate security, Global Corporation has become a benchmark for other companies that prioritize security and safety as a top priority in their business.

Application / Product / Project Official

Global App

Super Cross-platform application allows you to do social media / chat as well as a place for buying and selling businesses to find work

Global Bot App

Super cross-platform application allows you to handle lots of bots / userbots / AI for your assistants, making it easier for you in all your affairs

Global Studio Developer

The cross-platform Studio Developer application allows you to code on various platforms

Ads Gateway

Applikasi Cross platform advertising allows you to advertise on various platforms easily

Archivon

Applikasi Linux based operating system which will be released

Coinlox

Applikasi Cross Platform Wallet allows you to store money on the internet safely

Global Bot Telegram

Super Bot Telegram allows you to manage various chat groups / private / channels as well as a place to buy and sell the products we sell, you can buy this service from IDR: 25k / bulan $: 1,5 Dollar

Global Userbot Telegram

Super Bot Telegram allows you to manage various chat groups / private / channels as well as a place to buy and sell the products we sell, you can buy this service from IDR: 25k / bulan $: 1,5 Dollar

Global Bot Whatsapp

Super Bot Telegram allows you to manage various chat groups / private / channels as well as a place to buy and sell the products we sell, you can buy this service from IDR: 25k / bulan $: 1,5 Dollar

Social Media

Telegram  

  1. Group Developer Global Public

Product / Services

  1. Clone Bot / Userbot Hi, do you want to have a bot / userbot with lots of features?.
  • Features:
    • Repeat Message
    • Manage Chat Private / Channel / Group
  • Platform Support:
    • Telegram
    • Whatsapp
    • Twitter
    • Github
    • Google
  1. Products
    • Black Products
    • Group / Channel
    • Nsfw
    • Payment Gateway
    • Paid Promote
    • Pre Release / Beta
    • Promo Cheap
    • Source Code Bot / USerbot
    • Trade
  2. Services
    • Developer
    • Goal
    • Partner
    • Promote
    • Recommendation
    • Sortcut Cheat Sheet
    • Terminate
    • Upgrade

How To Buy Services Or Products | Cara Beli Jasa Atau Products

  • Via Telegram Bot

    • Englisth

      If you want to buy, you can use Telegram to automatically process the payment (if the long process is not a SCAM!! it's possible that the server is down so the process could take longer. If in doubt, tap the report menu then fill in a complaint)

      • Open Bot: https://t.me/GLOBAL_CORP_ORG_BOT
      • Fill in personal data / subscribe to the channel
      • Tap Main menu select services / products
      • Select Products / Services
      • Make sure there are enough coins
      • Fill in the required data
    • Indonesia

      Jika kamu ingin membeli bisa lewat telegram automatis pembayaran hingga proses (jika proses lama itu bukan SCAM !! kemungkinan server down jadi proses bisa lebih lama jika ragu tap menu report lalu isi keluhan)

      • Buka Bot: https://t.me/GLOBAL_CORP_ORG_BOT
      • Isi data pribadi / subscribe channel
      • Tap Main menu pilih services / products
      • Pilih Product / Services
      • Pastikan coin mencukupi
      • Isi data yang di butuhkan
  • Via Telegram USER

Video Tutorial Watch the video

  • Lewat App

    • English

      If you want to see a product/service with a full demo, you can buy it via the app

    • Indonesia

      jika kamu ingin melihat product / jasa dengan full demo kamu bisa beli lewat app

📺 Latest YouTube Videos

Userbot LIFE TIME Subsription Telegram Murah Unlimited Akun Ultra FAST | Global Corporation Tolong 😭 Siapapun beli satu jasa aku ntr aku kasih harga seiklasnya / ada yang mau donasi | GLOBAL Cara beli ai telegram versi bot dan cara pakai| Global Corporation Ai Userbot Telegram Demo Cara Pakai Dan Beli | Global Corporation CARA BELI USERBOT TELEGRAM CLOUD  | Global Corporation Cara Top Up Automatis Menggunakan Payment Gateway Di GLOBAL BOT APP

whisper_dart's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whisper_dart's Issues

Error - Lexical or Preprocessor Issue on whisper_flutter

I got an error using 'whisper_flutter 0.0.4' on IOS and also Android:

---> IOS

Lexical or Preprocessor Issue (Xcode): '../../src/whisper_flutter.c' file not found
/Users/xxx/.pub-cache/hosted/pub.dev/whisper_flutter-0.0.4/ios/Classes/whisper_dart.c:2:9

---> Android

Execution failed for task ':whisper_flutter:configureCMakeDebug[arm64-v8a]'.

[CXX1405] error when building with cmake using /Users/xxx/.pub-cache/hosted/pub.dev/whisper_flutter-0.0.4/src/CMakeLists.txt: Build command failed.
Error while executing process /Users/xxx/Library/Android/sdk/cmake/3.18.1/bin/cmake with arguments {-H/Users/xxx/.pub-cache/hosted/pub.dev/whisper_flutter-0.0.4/src -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=19 -DANDROID_PLATFORM=android-19 -DANDROID_ABI=arm64-v8a -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DANDROID_NDK=/Users/xxx/Library/Android/sdk/ndk/25.1.8937393 -DCMAKE_ANDROID_NDK=/Users/xxx/Library/Android/sdk/ndk/25.1.8937393 -DCMAKE_TOOLCHAIN_FILE=/Users/xxx/Library/Android/sdk/ndk/25.1.8937393/build/cmake/android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=/Users/xxx/Library/Android/sdk/cmake/3.18.1/bin/ninja -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/Users/xxx/Desktop/Projekte/Zaya/zaya/build/whisper_flutter/intermediates/cxx/Debug/214s131y/obj/arm64-v8a -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/Users/xxx/Desktop/Projekte/Zaya/zaya/build/whisper_flutter/intermediates/cxx/Debug/214s131y/obj/arm64-v8a -DCMAKE_BUILD_TYPE=Debug -B/Users/xxx/.pub-cache/hosted/pub.dev/whisper_flutter-0.0.4/android/.cxx/Debug/214s131y/arm64-v8a -GNinja}
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Users/xxx/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Users/xxx/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
CMake Warning at /Users/xxx/Library/Android/sdk/ndk/25.1.8937393/build/cmake/android-legacy.toolchain.cmake:415 (message):
An old version of CMake is being used that cannot automatically detect
compiler attributes. Compiler identification is being bypassed. Some
values may be wrong or missing. Update to CMake 3.19 or newer to use
CMake's built-in compiler identification.
Call Stack (most recent call first):
/Users/xxx/Library/Android/sdk/ndk/25.1.8937393/build/cmake/android.toolchain.cmake:54 (include)
/Users/xxx/Library/Android/sdk/cmake/3.18.1/share/cmake-3.18/Modules/CMakeDetermineSystem.cmake:93 (include)
CMakeLists.txt:6 (project)

CMake Warning at /Users/xxx/Library/Android/sdk/ndk/25.1.8937393/build/cmake/android-legacy.toolchain.cmake:415 (message):
An old version of CMake is being used that cannot automatically detect
compiler attributes. Compiler identification is being bypassed. Some
values may be wrong or missing. Update to CMake 3.19 or newer to use
CMake's built-in compiler identification.
Call Stack (most recent call first):
/Users/xxx/Library/Android/sdk/ndk/25.1.8937393/build/cmake/android.toolchain.cmake:54 (include)
/Users/xxx/.pub-cache/hosted/pub.dev/whisper_flutter-0.0.4/android/.cxx/Debug/214s131y/arm64-v8a/CMakeFiles/3.18.1-g262b901/CMakeSystem.cmake:6 (include)
/Users/xxx/.pub-cache/hosted/pub.dev/whisper_flutter-0.0.4/android/.cxx/Debug/214s131y/arm64-v8a/CMakeFiles/CMakeTmp/CMakeLists.txt:2 (project)

CMake Warning at /Users/xxx/Library/Android/sdk/ndk/25.1.8937393/build/cmake/android-legacy.toolchain.cmake:415 (message):
An old version of CMake is being used that cannot automatically detect
compiler attributes. Compiler identification is being bypassed. Some
values may be wrong or missing. Update to CMake 3.19 or newer to use
CMake's built-in compiler identification.
Call Stack (most recent call first):
/Users/xxx/Library/Android/sdk/ndk/25.1.8937393/build/cmake/android.toolchain.cmake:54 (include)
/Users/xxx/.pub-cache/hosted/pub.dev/whisper_flutter-0.0.4/android/.cxx/Debug/214s131y/arm64-v8a/CMakeFiles/3.18.1-g262b901/CMakeSystem.cmake:6 (include)
/Users/xxx/.pub-cache/hosted/pub.dev/whisper_flutter-0.0.4/android/.cxx/Debug/214s131y/arm64-v8a/CMakeFiles/CMakeTmp/CMakeLists.txt:2 (project)

CMake Error at CMakeLists.txt:13 (add_library):
Cannot find source file:

whisper.cpp/ggml.c
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx

CMake Error at CMakeLists.txt:12 (add_library):
Cannot find source file:

whisper.cpp/whisper.cpp

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
.hpp .hxx .in .txx

CMake Error at CMakeLists.txt:13 (add_library):
No SOURCES given to target: ggml

CMake Error at CMakeLists.txt:12 (add_library):
No SOURCES given to target: whisper

CMake Generate step failed. Build files cannot be regenerated correctly.

Thanks a lot for your work!

Seg fault error

Hi thanks for the lib,

I am receiving this error when running:

signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x170
Cause: null pointer dereference
    x0  0000000000000000  x1  0000007d35120cdc  x2  0000007c37e011c0  x3  00000079bbc23588
    x4  000000000000dc00  x5  0000000000000004  x6  000000000002e02e  x7  000000000002e02e
    x8  0000000000000000  x9  0000000000000000  x10 0000007c37c51000  x11 0000000000010010
    x12 0000000000000001  x13 0000007c37e0edd0  x14 0000007c37f3ef00  x15 0000000000000000
    x16 000000798ed70bf8  x17 000000798ec82b10  x18 00000079ac176000  x19 00000079bbc23b20
    x20 0000000000000000  x21 00000079bbc239b0  x22 0000000000003700  x23 0000000000003700
    x24 0000007a67cef990  x25 0000000000000030  x26 00000079bbc239b1  x27 0000007806514300
    x28 0000000800000078  x29 00000079bbc23aa0
    lr  000000798ecc0678  sp  00000079bbc235c0  pc  000000798ec82b10  pst 0000000060000000
backtrace:
      #00 pc 0000000000070b10  /data/app/~~E_I524WaE26A0uimN0qXJQ==/com.example.-AH_tk5UeICyziNsYliaA7w==/lib/arm64/libwhisper_android.so (whisper_is_multilingual+0)
      #01 pc 00000000000ae674  /data/app/~~E_I524WaE26A0uimN0qXJQ==/com.example.-AH_tk5UeICyziNsYliaA7w==/lib/arm64/libwhisper_android.so (transcribe(nlohmann::json_abi_v3_11_2::basic_json<std::__ndk1::map, std::__ndk1::vector, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >, bool, long, unsigned long, double, std::__ndk1::allocator, nlohmann::json_abi_v3_11_2::adl_serializer, std::__ndk1::vector<unsigned char, std::__ndk1::allocator<unsigned char> > >)+3292)
      #02 pc 00000000000aee40  /data/app/~~E_I524WaE26A0uimN0qXJQ==/com.example.-AH_tk5UeICyziNsYliaA7w==/lib/arm64/libwhisper_android.so (request+176)
      #03 pc 0000000000006f64  [anon:dart-code]

WhisperAudioconvert return Permission denied in Android

When using WhisperAudioconvert.convert() to convert the file to a wav file i got this error :

Unhandled Exception: ProcessException: Permission denied

My audio file is in the assets folder.
What I have try so far :

  • Add and ask for the storage permission
  • Use getTemporaryDirectory() / getApplicationDocumentsDirectory() for the audio output path
  • Create a copy of the audio file from asset in tempDirectory / ApplicationDirectory
  • Create a new directory in ApplicationDirectory and use this in the path

So far none of this work and I still have the error. Any idea of what I could do ?

Full Code & error (Here I made a copy of the file from asset to a new directory called debugwhisper in the ApplicationDirectory) :

      Directory appDocumentsDirectory = await getApplicationDocumentsDirectory();
      String appDocumentsPath = appDocumentsDirectory.path;
      Directory dir = await Directory('$appDocumentsPath/debugwhisper').create(recursive: true);
      var status = await Permission.storage.request();
      final bytes = await rootBundle.load('assets/audio.mp3');
      final buffer = bytes.buffer;
      final newPathAudio = '${dir.path}/audio.mp3';
      await File(newPathAudio).writeAsBytes(
          buffer.asUint8List(bytes.offsetInBytes, bytes.lengthInBytes));
      print(status);
      Transcribe transcribe = await whisper!.transcribe(
        audio: WhisperAudioconvert.convert(
          audioInput: File(newPathAudio),
          audioOutput: File("${dir.path}/convertedAudio.wav"),
        ).path,
        model: pathModel,
        language: lang, // language
      );

E/flutter ( 5261): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: ProcessException: Permission denied E/flutter ( 5261): Command: ffmpeg -i /data/user/0/com.example.whisper_poc/app_flutter/debugwhisper/audio.mp3 -ar 16000 -ac 1 -c:a pcm_s16le /data/user/0/com.example.whisper_poc/app_flutter/debugwhisper/convertedAudio.wav

No podspec found error when compiling iOS project using whisper_flutter

Hello, thank you very much for providing whisper_dart and whisper_flutter.
When I tried to compile for iOS using flutter build ios, I encountered an error.
The error output is as follows (some seemingly irrelevant content has been removed):

Running pod install...                                             829ms
CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

    Finding Podfile changes
      A whisper_flutter
      - Flutter
      - audioplayers_darwin
       ......
      - url_launcher_ios

    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `audioplayers_darwin` from `.symlinks/plugins/audioplayers_darwin/ios`
       ......
    -> Fetching podspec for `url_launcher_ios` from `.symlinks/plugins/url_launcher_ios/ios`
    -> Fetching podspec for `whisper_flutter` from `.symlinks/plugins/whisper_flutter/ios`
    [!] No podspec found for `whisper_flutter` in `.symlinks/plugins/whisper_flutter/ios`


    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/path_source.rb:14:in `block in fetch'
    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/external_sources/path_source.rb:11:in `fetch'
    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:993:in `fetch_external_source'
    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:972:in `block (2 levels) in fetch_external_sources'
    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:971:in `each'
    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:971:in `block in fetch_external_sources'
    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:970:in `fetch_external_sources'
    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/analyzer.rb:117:in `analyze'
    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:416:in `analyze'
    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:241:in `block in resolve_dependencies'
    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:240:in `resolve_dependencies'
    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:161:in `install!'
    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
    /usr/local/lib/ruby/gems/3.2.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
    /usr/local/lib/ruby/gems/3.2.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
    /usr/local/opt/ruby/bin/pod:25:in `load'
    /usr/local/opt/ruby/bin/pod:25:in `<main>'

Error running pod install

I think there may be something wrong with the configuration of the podspec. After checking the relevant code, I noticed that the podspec file should be this file:
package/whisper_flutter/ios/whisper_dart.podspec
which describes the pod name as whisper_flutter, but the name of this file is whisper_dart.podspec.
Perhaps this is the reason for the error.

Cannot convert local mp3 file to text

First of all, I appreciate you made this package. I integrated whisper package to my flutter app but when I give my local mp3 file to audioInput it says 'audio input not found'.

void main(List<String> arguments) { DateTime time = DateTime.now(); // print(res); Whisper whisper = Whisper( whisperLib: "whisper.cpp/whisper.so", ); try { var res = whisper.request( whisperRequest: WhisperRequest.fromWavFile( audio: WhisperAudioconvert.convert( audioInput: File( "/home/hexaminate/Documents/HEXAMINATE/app/ai/whisper_dart/samples/audio.ogg"), audioOutput: File( "/home/hexaminate/Documents/HEXAMINATE/app/ai/whisper_dart/samples/output.wav"), ), model: File( "/home/hexaminate/Documents/HEXAMINATE/app/ai/whisper_dart/models/ggml-model-whisper-small.bin"), ), ); print(res.toString()); print(convertToAgo(time.millisecondsSinceEpoch)); } catch (e) { print(e); } }

the message console's give me is;

-flutter: audio input not found

Has anyone tried the flutter example on iOS?

I have tried to run example of the whisper model using flutter but even when build the whisper.cpp library and embedding it in the Xcode project it failed with:
flutter: Invalid argument(s): Failed to lookup symbol 'request': dlsym(RTLD_DEFAULT, request): symbol not found

I have located this error in whisper_dart.dart on line 38:
var res = openLib(whisperLib: whisperLib).lookupFunction<whisper_request_native, whisper_request_native>("request").call(whisperRequest.toString().toNativeUtf8());

This lookupFunction returns null, even with the dylib loaded. Is there any way to get pass this?

How to use whisper_dart or whisper_flutter for a Flutter app in Windows and then for Android?

Thank you for providing whisper_dart and whisper_flutter!
I'm new to Flutter app development. I just finished the tutorial to create a new "Hello World" Flutter app with VS Code.
Could you please give me more instructions?

So far, I'm copying the example with whisper_flutter (found at https://pub.dev/packages/whisper_flutter/example), for lib\main.dart, but got errors probably with the following lines:
WidgetsFlutterBinding.ensureInitialized(); DynamicLibrary.open("libwhisper.so");

but I got the following errors:
Launching lib\main.dart on Windows in debug mode... main.dart:1 LINK : fatal error LNK1149: output filename matches input filename 'C:\Users\yubrs\dev_windows\whisper_flutter_example\build\windows\plugins\whisper_flutter\shared\Debug\whisper.lib' [C:\Users\yubrs\dev_windows\whisper_flutter_example\build\windows\plugins\whisper_flutter\shared\whisper_flutter.vcxproj] Exception: Build process failed. Exited (sigterm)

I suspect that besides copying the example code, I might need to do more setup in my project for the app.
But what should I do? Thanks for your help!

(My environment is Windows 11, and I can use Ubuntu/WSL2).

Error when running in Macos after clicking transcribe

Hi
I followed the instructions to build the file in native_lib.

I got a libwhisper.dylib file
I renamed it libwhisper.so and copied it into the futter lib folder
I am able to build and run but when I click transcribe, I get the following error:

flutter: Invalid argument(s): Failed to lookup symbol 'request': dlsym(RTLD_DEFAULT, request): symbol not found

══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
The following _TypeError was thrown while handling a gesture:
type 'Future<dynamic>' is not a subtype of type 'String'

When the exception was thrown, this was the stack:
#0      _HomePageState.build.<anonymous closure>.<anonymous closure> (package:whisper_dart_my_first_test_v2/pages/home_page.dart:82:19)
dart-lang/ffi#1      State.setState (package:flutter/src/widgets/framework.dart:1133:30)
dart-lang/ffi#2      _HomePageState.build.<anonymous closure> (package:whisper_dart_my_first_test_v2/pages/home_page.dart:80:17)
dart-lang/ffi#3      _InkResponseState.handleTap (package:flutter/src/material/ink_well.dart:1096:21)
dart-lang/ffi#4      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:253:24)
dart-lang/ffi#5      TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:627:11)
dart-lang/ffi#6      BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:306:5)
dart-lang/ffi#7      BaseTapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:239:7)
dart-lang/ffi#8      PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:615:9)
dart-lang/ffi#9      PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:98:12)
dart-lang/ffi#10     PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:143:9)
dart-lang/ffi#11     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:625:13)
dart-lang/ffi#12     PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:141:18)
dart-lang/ffi#13     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:127:7)
dart-lang/ffi#14     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:460:19)
dart-lang/ffi#15     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:440:22)
dart-lang/ffi#16     RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:336:11)
dart-lang/ffi#17     GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:395:7)
dart-lang/ffi#18     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:357:5)
dart-lang/ffi#19     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:314:7)
dart-lang/ffi#20     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:295:7)
dart-lang/ffi#21     _invoke1 (dart:ui/hooks.dart:164:13)
dart-lang/ffi#22     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:361:7)
dart-lang/ffi#23     _dispatchPointerDataPacket (dart:ui/hooks.dart:91:31)

Handler: "onTap"
Recognizer:
  TapGestureRecognizer#b6523
════════════════════════════════════════════════════════════════════════════════════════════════════

What did I do wrong here?

It's running but it's taking too long to translate. Is this normal?

Hello friend, you did a good job and I cloned the example you created .. I downloaded the download model and a 20 second audio of mine .. however it is taking too long to transcribe .. approximately 5 minutes do you know if this is normal? I'm trying to use the package in an application I'm creating. Thanks in advance for your help :)

where to place .so file

Hi thanks for the lib,

Rookie question but where does the libwhisper_android.so file go?
I have tried various placements outside of the lib folder, inside of the lib folder and in the assets folder but to no avail.

Thanks

Initialize Compile library automatically

We can make the setup of this package easier by downloading the Compile library automatically when the program runs for the first time.

I think isar is doing something similar where it downloads the correct file depending on os when it first runs and then uses it again without downloading it again.

setup instructions

Hi, thanks for the great plugin, but unfortunately i cannot able to run it.

Whisper whisper = Whisper(whisperLib: "libwhisper.so");
Version v = await w.getVersion();
print(v?.rawData);

i want to know is there any other setup or configuration needs to be done before calling whisper. i am getting error in above code

Invalid argument(s): Failed to load dynamic library 'libwhisper.so': dlopen failed: library "libwhisper.so" not found

also i am confused at libwhisper.so file where to place or it will created automatically ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.