🎡 A cross-platform media playback library for C/C++ with good number of features (only Windows & Linux).

Overview

libwinmedia

A cross-platform media playback library for C/C++ & Flutter with good number of features.

Example

A very simple example can be as follows.

C++

#include "libwinmedia/libwinmedia.hpp"

int32_t main(int32_t ac, const char** av) {
  using namespace std;
  using namespace lwm;
  if (ac < 2) {
    cout << "No URI provided.\n"
         << "Example Usage:\n" << av[0]
         << " file://C:/alexmercerind/music.mp3\n" << av[0]
         << " https://alexmercerind.github.io/video.mp4\n";
    return EXIT_FAILURE;
  }
  auto player = Player(0);
  auto media = Media(av[1]);
  player.Open(vector<Media>{media});
  player.Play();
  player.events()->Position([](int32_t position) -> void {
    cout << "Current playback position is " << position << " ms.\n";
  });
  cin.get();
  return EXIT_SUCCESS;
}

Flutter

More about Flutter here or on the pub.dev.

dependencies:
  ...
  libwinmedia: ^0.0.1
import 'package:libwinmedia/libwinmedia.dart';

void main() {
  LWM.initialize();
  runApp(MyApp());
}

void demo() {
  var player = Player(id: 0);
  player.streams.medias.listen((List<Media> medias) {});
  player.streams.isPlaying.listen((bool isPlaying) {});
  player.streams.isBuffering.listen((bool isBuffering) {});
  player.streams.isCompleted.listen((bool isCompleted) {});
  player.streams.position.listen((Duration position) {});
  player.streams.duration.listen((Duration duration) {});
  player.streams.index.listen((int index) {});
  player.open([
    Media(uri: 'https://www.example.com/media/music.mp3'),
    Media(uri: 'file://C:/documents/video.mp4'),
  ]);
  player.play();
  player.seek(Duration(seconds: 20));
  player.nativeControls.update(
    album: 'Fine Line',
    albumArtist: 'Harry Styles',
    trackCount: 12,
    artist: 'Harry Styles',
    title: 'Lights Up',
    trackNumber: 1,
    thumbnail: File('album_art.png'),
  );
}

Bindings

  • just_audio: Cross platform audio playback library for Flutter, working on Android, iOS, macOS, Windows, Linux & Web.
  • libwinmedia-py: libwinmedia bindings for Python.
  • libwinmedia.dart: libwinmedia bindings for Flutter.

Support

Consider supporting the project by starring the repository or buying me a coffee.

Thanks a lot for your support.

Documentation

Setup

For using the library on Windows, you can download the pre-compiled shared library from the releases page & headers can be found here.

Usage

Create a new player.

Player player = Player(0);

Create a media to open inside player.

Media media = Media("file://C:/alexmercerind/music.mp3");
int32_t duration = media.duration();

Play the medias.

player.Open(std::vector<lwm::Media>{media});

Control playback.

player.Play();

player.Pause();

player.SetVolume(0.69);

player.SetRate(1.2);

player.Seek(10000);

player.SetIsLooping(false);

player.SetAudioBalance(1.0);

Listen to playback events.

player.events()->Position(
  [=](int position) -> void {}
);

player.events()->Duration(
  [=](int duration) -> void {}
);

player.events()->Rate(
  [=](float rate) -> void {}
);

player.events()->Volume(
  [=](float volume) -> void {}
);

player.events()->IsPlaying(
  [=](bool isPlaying) -> void {}
);

// Other events.

Create native system media controls.

Pass function as argument to receive event callbacks.

auto controls = lwm::NativeControls(
  [](auto button) -> void {
    if (button == NativeControlsButton::Play) std::cout << "Play clicked.\n";
    if (button == NativeControlsButton::Pause) std::cout << "Pause clicked.\n";
  }
);

Update the native system media controls.

controls.Update(
  std::make_shared<lwm::MusicNativeControlState>(
    "album_artist",
    "album",
    "track_count",
    "artist",
    "title",
    "track_number"
  ),
  "file://C:/Users/Hitesh/Pictures/AlbumArt.PNG"
);

Clear the native system media controls.

controls.Dispose();

Extract metadata tags.

auto tags = lwm::Tags::FromMusic(std::wstring(music_file));
std::wcout << "album        : " << tags.album() << ".\n"
           << "album_artist : " << tags.album_artist() << ".\n"
           << "bitrate      : " << tags.bitrate() << ".\n";
           
// Other metadata tags.

Extract album art.

lwm::Tags::ExtractThumbnail(
  music_file,
  TO_WIDESTRING(std::filesystem::current_path().string()),
  "ExtractedAlbumArt.PNG",
  lwm::ThumbnailMode::Music,
  400
);

Show video in a window.

For showing video, you must instantiate player as follows.

Player player = Player(0, true);

Control video output.

player.ShowWindow();

player.CloseWindow();

Notes

Windows

For showing video

You need to embed a manifest with maxversiontested property to the generated executable. The library creates a separate win32 window on another thread & uses XAML islands to render the MediaPlayerElement in it (for showing video). Learn more here & here.

<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
    <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
        <application>
            <maxversiontested Id="10.0.18362.0"/>
            <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
        </application>
    </compatibility>
</assembly>

Aim

The main goals of creating libwinmedia are:

  • Having high-level, user friendly library for media playback in C++.
  • Having small footprint, by using already existing OS APIs.
  • Having necessary things like network playback, event callbacks etc.
  • Being able to build similar high-level bindings to other programming languages, by just looking up for methods inside a single shared library.
  • Supporting multiple playback instances.
  • Supporting media tag-parsing & other things like lockscreen/system notifications.
  • Being permissively licensed.
  • Being cross-platform **.

** Currently only working on Windows & Linux.

License

Copyright (c) 2021 Hitesh Kumar Saini [email protected]

This library & work under this repository is MIT licensed.

Contributions welcomed.

Comments
  • Unable to run the flutter example on windows

    Unable to run the flutter example on windows

    Steps to reproduce:

    1. Simply run the flutter example on windows

    Issue: I am not able to run the example on Windows.

    Flutter Run Logs: [ +144 ms] executing: [C:\Users\Vipin Malik\fvm\versions\stable/] git -c log.showSignature=false log -n 1 --pretty=format:%H [+1045 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H [ +3 ms] f4abaa0735eba4dfd8f33f73363911d63931fe03 [ +7 ms] executing: [C:\Users\Vipin Malik\fvm\versions\stable/] git tag --points-at f4abaa0735eba4dfd8f33f73363911d63931fe03 [ +148 ms] Exit code 0 from: git tag --points-at f4abaa0735eba4dfd8f33f73363911d63931fe03 [ +9 ms] 2.2.3 [ +10 ms] executing: [C:\Users\Vipin Malik\fvm\versions\stable/] git rev-parse --abbrev-ref --symbolic @{u} [ +57 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u} [ +2 ms] origin/stable [ +6 ms] executing: [C:\Users\Vipin Malik\fvm\versions\stable/] git ls-remote --get-url origin [ +48 ms] Exit code 0 from: git ls-remote --get-url origin [ +2 ms] https://github.com/flutter/flutter.git [ +205 ms] executing: [C:\Users\Vipin Malik\fvm\versions\stable/] git rev-parse --abbrev-ref HEAD [ +62 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD [ +2 ms] stable [ +120 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ +2 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ +6 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ +4 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ +88 ms] executing: C:\Users\Vipin Malik\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l [ +38 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update. [ +2 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update. [ +7 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update. [ +9 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update. [ +2 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update. [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update. [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update. [ +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update. [ +116 ms] executing: C:\Users\Vipin Malik\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l [ +33 ms] Skipping pub get: version match. [ +80 ms] Found plugin libwinmedia at F:\Open-Source\libwinmedia\flutter
    [ +643 ms] Found plugin libwinmedia at F:\Open-Source\libwinmedia\flutter
    [ +170 ms] Initializing file store [ +15 ms] Skipping target: gen_localizations [ +7 ms] complete [ +8 ms] Launching lib\main.dart on Windows in debug mode... [ +10 ms] C:\Users\Vipin Malik\fvm\versions\stable\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev C:\Users\Vipin Malik\fvm\versions\stable\bin\cache\artifacts\engine\windows-x64\frontend_server.dart.snapshot --sdk-root C:\Users\Vipin Malik\fvm\versions\stable\bin\cache\artifacts\engine\common\flutter_patched_sdk/ --incremental --target=flutter --debugger-module-names --experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true --output-dill C:\Users\VIPINM~1\AppData\Local\Temp\flutter_tools.5c57fce5\flutter_tool.ca55c4ca\app.dill --packages F:\Open-Source\libwinmedia\flutter\example.dart_tool\package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts --track-widget-creation --filesystem-scheme org-dartlang-root --initialize-from-dill build\3c113a45063dc6628e68a4111abcacad.cache.dill.track.dill --enable-experiment=alternative-invalidation-strategy [ +60 ms] executing: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -format json -products * -utf8 -latest -version 16 -requires Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Component.VC.Tools.x86.x64 Microsoft.VisualStudio.Component.VC.CMake.Project [ +44 ms] Exit code 0 from: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -format json -products * -utf8 -latest -version 16 -requires Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Component.VC.Tools.x86.x64 Microsoft.VisualStudio.Component.VC.CMake.Project [ +3 ms] [ { "instanceId": "a458a554", "installDate": "2020-09-23T17:57:52Z", "installationName": "VisualStudio/16.7.4+30517.126", "installationPath": "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community", "installationVersion": "16.7.30517.126", "productId": "Microsoft.VisualStudio.Product.Community", "productPath": "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe", "state": 4294967295, "isComplete": true, "isLaunchable": true, "isPrerelease": false, "isRebootRequired": false, "displayName": "Visual Studio Community 2019", "description": "Powerful IDE, free for students, open-source contributors, and individuals", "channelId": "VisualStudio.16.Release", "channelUri": "https://aka.ms/vs/16/release/channel", "enginePath": "C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service", "releaseNotes": "https://go.microsoft.com/fwlink/?LinkId=660893#16.7.4", "thirdPartyNotices": "https://go.microsoft.com/fwlink/?LinkId=660909", "updateDate": "2020-09-23T17:57:51.9916061Z", "catalog": { "buildBranch": "d16.7", "buildVersion": "16.7.30517.126", "id": "VisualStudio/16.7.4+30517.126", "localBuild": "build-lab", "manifestName": "VisualStudio", "manifestType": "installer", "productDisplayVersion": "16.7.4", "productLine": "Dev16", "productLineVersion": "2019", "productMilestone": "RTW", "productMilestoneIsPreRelease": "False", "productName": "Visual Studio", "productPatchVersion": "4", "productPreReleaseMilestoneSuffix": "1.0", "productSemanticVersion": "16.7.4+30517.126", "requiredEngineVersion": "2.7.3132.26759" }, "properties": { "campaignId": "", "canceled": "0", "channelManifestId": "VisualStudio.16.Release/16.7.4+30517.126", "nickname": "", "setupEngineFilePath": "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installershell.exe" } } ] [ +9 ms] Building Windows application... [ +37 ms] <- compile package:libwinmedia_example/main.dart [ +26 ms] executing: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe -S F:\Open-Source\libwinmedia\flutter\example\windows -B build\windows -G Visual Studio 16 2019 [ +31 ms] List of devices attached [ +9 ms] List of devices attached [+1156 ms] -- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.19042. [ +63 ms] CMake Error at flutter/ephemeral/.plugin_symlinks/libwinmedia/windows/CMakeLists.txt:7 (add_subdirectory): [ +7 ms] add_subdirectory given source [ +6 ms] "F:/Open-Source/libwinmedia/flutter/example/windows/flutter/ephemeral/.plugin_symlinks/libwinmedia/windows/../.master" [ +1 ms] which is not an existing directory. [ +1 ms] -- Configuring incomplete, errors occurred! [ +1 ms] See also "F:/Open-Source/libwinmedia/flutter/example/build/windows/CMakeFiles/CMakeOutput.log". [ +32 ms] Building Windows application... (completed in 1,352ms) [+13400 ms] Exception: Unable to generate build files [ +3 ms] "flutter run" took 16,201ms. [ +16 ms] #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3) #1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:663:9) #2 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1043:27) #3 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #4 CommandRunner.runCommand (package:args/command_runner.dart:196:13) #5 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:284:9) #6 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #7 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:232:5) #8 run.. (package:flutter_tools/runner.dart:62:9) #9 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) #10 main (package:flutter_tools/executable.dart:91:3)

    [ +269 ms] ensureAnalyticsSent: 264ms [ +5 ms] Running shutdown hooks [ +5 ms] Shutdown hooks complete [ +1 ms] exiting with code 1

    Flutter Doctor Logs: Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [Version 10.0.19042.1237], locale en-US) [√] Android toolchain - develop for Android devices (Android SDK version 29.0.3) [√] Chrome - develop for the web [√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.7.4) [√] Android Studio (version 4.1.0) [√] IntelliJ IDEA Community Edition (version 2020.3) [√] VS Code (version 1.59.1) [√] Connected device (3 available)

    β€’ No issues found!

    question 
    opened by 0Vipin0 15
  • Freeze on Linux

    Freeze on Linux

    The Flutter example produces this error on Linux:

    $ cd flutter/example
    $ flutter run -d linux
    Launching lib/main.dart on Linux in debug mode...
    libwinmedia - 0.0.2
    -------------------
    Building on Linux against GTK 3.0 & WebKit2 4.0
    C++ Standard: 17
    Enabled Dart VM NativePorts callbacks.
    /home/ryan/projects/libwinmedia/flutter/example/linux/flutter/ephemeral/.plugin_symlinks/libwinmedia/.master/linux/player.hpp:12:10: fatal error: '../external/webview/webview.h' file not found
    Building Linux application...
    Exception: Build process failed
    

    Do I need to copy or symlink some files into external?

    opened by ryanheise 12
  • Linux build error (Flutter snap)

    Linux build error (Flutter snap)

    Hello. I have a error while building my app. After adding to pubspec.yaml:

    libwinmedia: ^0.0.6
    just_audio_libwinmedia: any
    
    Launching lib/main.dart on Linux in debug mode...
    lib/main.dart:1
    CMake Error at flutter/ephemeral/.plugin_symlinks/libwinmedia/.master/CMakeLists.txt:1 (cmake_minimum_required):
      CMake 3.15 or higher is required.  You are running version 3.10.2
    
    
    Exception: Unable to generate build files
    Exited (sigterm)
    

    flutter doctor

    Doctor summary (to see all details, run flutter doctor -v):
    [βœ“] Flutter (Channel stable, 2.5.1, on Ubuntu 20.10 5.8.0-63-generic, locale ru_RU.UTF-8)
    [βœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    [βœ“] Chrome - develop for the web
    [βœ“] Linux toolchain - develop for Linux desktop
    [βœ“] Android Studio (version 2020.3)
    [βœ“] Android Studio (version 4.2)
    [βœ“] Android Studio
    [βœ“] VS Code (version 1.60.2)
    [βœ“] Connected device (2 available)
    
    β€’ No issues found!
    

    I use Flutter snap.

    opened by Sotneo 7
  • Flutter version doesn't work on Ubuntu 20.04

    Flutter version doesn't work on Ubuntu 20.04

    Hi,

    when I add the following code to the flutter example app

    void main() {
      LWM.initialize();
      var player = Player(id: 0);
      player.open([
        Media(uri: 'file://home/osboxes/click.mp3'),
      ]);
      player.play();
      
      runApp(const MyApp());
    }
    

    I get the following output

    Launching lib/main.dart on Linux in debug mode...
    Building Linux application...
    libwinmedia - 0.0.3
    -------------------
    Building on Linux against GTK 3.0 & WebKit2 4.0
    C++ Standard: 17
    Enabled Dart VM NativePorts callbacks.
    Debug service listening on ws://127.0.0.1:39813/B6JZIhK31HU=/ws
    Syncing files to device Linux...
    WebKit wasn't able to find a WebVTT encoder. Not continuing without platform support for subtitles.
    [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: type 'int' is not a subtype of type 'PlayerErrorCode'
    #0      LWM.receivePort.<anonymous closure> (package:libwinmedia/src/internal.dart:113:44)
    #1      _rootRunUnary (dart:async/zone.dart:1444:13)
    #2      _CustomZone.runUnary (dart:async/zone.dart:1335:19)
    #3      _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
    #4      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:341:11)
    #5      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
    #6      _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:733:19)
    #7      _StreamController._add (dart:async/stream_controller.dart:607:7)
    #8      _StreamController.add (dart:async/stream_controller.dart:554:5)
    #9      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:187:12)
    
    

    It seems that using libwebkit2gtk-4.0-dev requires WebVTT encoder even for playing sound... ?

    Thank you,

    W

    question 
    opened by WWWWWWhite 6
  • flutter build web - error occurs even not using this plugin(just import)

    flutter build web - error occurs even not using this plugin(just import)

    Error:

    /.../libwinmedia-0.0.7/lib/src/player.dart:2:8: Error: Not found: 'dart:ffi'
    import 'dart:ffi';
           ^
    
    /.../libwinmedia-0.0.7/lib/src/internal.dart:2:8: Error: Not found: 'dart:ffi'
    import 'dart:ffi';
    
    

    Environment:

    Flutter 2.8.1 β€’ channel stable β€’ https://github.com/flutter/flutter.git
    Framework β€’ revision 77d935af4d (6 weeks ago) β€’ 2021-12-16 08:37:33 -0800
    Engine β€’ revision 890a5fca2e
    Tools β€’ Dart 2.15.1
    
    invalid 
    opened by sleepreading 5
  • flutter 2.10 with vs2022 build error

    flutter 2.10 with vs2022 build error

    Flutter 2.10.0 β€’ channel stable β€’ https://github.com/flutter/flutter.git
    Framework β€’ revision 5f105a6ca7 (3 days ago) β€’ 2022-02-01 14:15:42 -0800
    Engine β€’ revision 776efd2034
    Tools β€’ Dart 2.16.0 β€’ DevTools 2.9.2
    
    -----------------------------
    
    Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
    Launching lib\main.dart on Windows in debug mode...
    libwinmedia - 0.0.3
    -------------------
    Building on Windows against C++/WinRT 2.0.210806.1
    C++ Standard: 17
    Enabled Dart VM NativePorts callbacks.
    d:\xxx\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3075: ε‘½δ»€β€œsetlocal [D:\demo\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    d:\xxx\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3075: D:\demo\windows\flutter\ephemeral\.plugin_symlinks\libwinmedia\master\nuget.exe install Microsoft.Windows.CppWinRT -Version 2.0.210806.1 -ExcludeVersion -OutputDirectory D:/dev/src/dart/zeus/windows/flutter/ephemeral/.plugin_symlinks/libwinmedia/master/external [D:\demo\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    d:\xxx\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3075: if %errorlevel% neq 0 goto :cmEnd [D:\demo\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    d:\xxx\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3075: :cmEnd [D:\demo\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    d:\xxx\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3075: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [D:\demo\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    d:\xxx\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3075: :cmErrorLevel [D:\demo\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    d:\xxx\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3075: exit /b %1 [D:\demo\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    d:\xxx\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3075: :cmDone [D:\demo\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    d:\xxx\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3075: if %errorlevel% neq 0 goto :VCEnd [D:\demo\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    d:\xxx\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(146,5): error MSB3075: :VCEndβ€ε·²ι€€ε‡ΊοΌŒδ»£η δΈΊ 5。请ιͺŒθ―ζ‚¨ζ˜―否ζ‹₯ζœ‰θΏθ‘Œζ­€ε‘½δ»€ηš„θΆ³ε€Ÿζƒι™γ€‚ [D:\demo\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    Exception: Build process failed.
    Exited (sigterm)
    
    
    opened by sleepreading 3
  • Cannot build on Windows

    Cannot build on Windows

    Hello,

    we are getting Build error for this package while running on windows.

    Steps Performed:

    1. Create Empty Flutter Project Using flutter create demo command.
    2. Add libwinmedia: ^0.0.7 as Pubspec Depencency and pub get
    3. Tried to run flutter project on windows ,got following error

    Build Error

    Launching lib\main.dart on Windows in debug mode...
    lib\main.dart:1
    libwinmedia - 0.0.3
    -------------------
    Building on Windows against C++/WinRT 2.0.210806.1
    C++ Standard: 17
    Enabled Dart VM NativePorts callbacks.
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: The command "setlocal [E:\flutter_projects\test\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: E:\flutter_projects\test\windows\flutter\ephemeral\.plugin_symlinks\libwinmedia\master\nuget.exe install Microsoft.Windows.CppWinRT -Version 2.0.210806.1 -ExcludeVersion -OutputDirectory E:/flutter_projects/test/windows/flutter/ephemeral/.plugin_symlinks/libwinmedia/master/external [E:\flutter_projects\test\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [E:\flutter_projects\test\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: :cmEnd [E:\flutter_projects\test\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [E:\flutter_projects\test\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: :cmErrorLevel [E:\flutter_projects\test\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: exit /b %1 [E:\flutter_projects\test\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: :cmDone [E:\flutter_projects\test\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [E:\flutter_projects\test\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(145,5): error MSB3073: :VCEnd" exited with code 1. [E:\flutter_projects\test\build\windows\plugins\libwinmedia\libwinmedia\CPP_WINRT_DOWNLOAD.vcxproj]
    Exception: Build process failed.
    Exited (sigterm)
    
    

    Flutter doctor output

    [√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.19044.1415], locale en-IN)
        β€’ Flutter version 2.8.1 at C:\src\flutter
        β€’ Upstream repository https://github.com/flutter/flutter.git
        β€’ Framework revision 77d935af4d (13 days ago), 2021-12-16 08:37:33 -0800
        β€’ Engine revision 890a5fca2e
        β€’ Dart version 2.15.1
    
    [√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)    
        β€’ Android SDK at C:\Users\Dell\AppData\Local\Android\sdk
        β€’ Platform android-31, build-tools 30.0.3
        β€’ Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
        β€’ Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)   
        β€’ All Android licenses accepted.
    
    [√] Chrome - develop for the web
        β€’ Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
    
    [√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.8)      
        β€’ Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
        β€’ Visual Studio Community 2019 version 16.11.32002.261
        β€’ Windows 10 SDK version 10.0.19041.0
    
    [√] Android Studio (version 4.1)
        β€’ Android Studio at C:\Program Files\Android\Android Studio
        β€’ Flutter plugin can be installed from:
           https://plugins.jetbrains.com/plugin/9212-flutter
        β€’ Dart plugin can be installed from:
           https://plugins.jetbrains.com/plugin/6351-dart
        β€’ Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)   
    
    [√] VS Code (version 1.63.2)
        β€’ VS Code at C:\Users\Dell\AppData\Local\Programs\Microsoft VS Code
        β€’ Flutter extension version 3.29.0
    
    [√] Connected device (3 available)
        β€’ Windows (desktop) β€’ windows β€’ windows-x64    β€’ Microsoft Windows [Version 10.0.19044.1415]
        β€’ Chrome (web)      β€’ chrome  β€’ web-javascript β€’ Google Chrome 96.0.4664.110
        β€’ Edge (web)        β€’ edge    β€’ web-javascript β€’ Microsoft Edge 96.0.1054.57
    
    β€’ No issues found!
    
    

    Can you please help on solving this issue? What are we missing?

    opened by gladson97 1
  • Report errors

    Report errors

    Can be done through this event handler on windows and

        _audioElement.addEventListener('error', (event) {
          _durationCompleter?.completeError(_audioElement.error!);
        });
    

    on linux.

    opened by bdlukaa 1
  • 18: fix locale issues with printing using std::to_string for floats

    18: fix locale issues with printing using std::to_string for floats

    Fixes #18

    std::to_string output depends on the locale on the machine it happens to be running on. For floats, this produces invalid output with comma instead of period as a decimal separator, such as 0,3 instead of 0.3.

    opened by esiqveland 0
  • Make linux window harder to find when not required

    Make linux window harder to find when not required

    Current version shows a temporary window even if show_window is false. Constructor of webview::webview always calls gtk_widget_show_all, which displays the window.

    https://github.com/webview/webview/blob/f540d88dde4ebb2108833cf0a413742941ce4eca/webview.h#L502

    This PR makes the window harder to find by doing:

    1. Set window type to GTK_WINDOW_POPUP. This type of window has no border and does not display in taskbar.
    2. Resize window to width=1, height=1.
    3. Then hide the window(widget)
    opened by Yesterday17 0
  • Buffering Position

    Buffering Position

    Know the current buffering position.

    Can be done simply with WinRT:

    g_media_players.at(player_id).BufferingProgress();
    

    and Linux:

          "   player.addEventListener('progress' (event) => {"
          "       var duration = myAudio.duration; " 
          "       if (myAudio.buffered.length > 0) { " 
          "           buffering(myAudio.buffered.end(myAudio.buffered.length - 1) * 1000);"
          "       } " 
          "   });"
    
    enhancement 
    opened by bdlukaa 0
  • linux: set playback rate and set volume not working

    linux: set playback rate and set volume not working

    When running the example I noticed only volume set to max (1.0) works. everything < 1.0 gets used as zero volume. Noticed the same for playback rate.

    I tracked it down to std::to_string being locale aware, and in my locale it prints a float with comma , as the decimal point, breaking the volume setting.

    https://github.com/harmonoid/libwinmedia/blob/master/linux/player.hpp#L410

    opened by esiqveland 0
  • Add elinux compatibility

    Add elinux compatibility

    I'm trying to get this library to work on elinux, the authors put in a lot of work and ported a couple of different plugins to make them compatible for elinux. I forked the repo to start developing a port but the library includes gtk and and flutter_linux which stumped me on how to continue. So I'm going to need some help on it πŸ˜…

    The flutter elinux author has already developed an api compatible version of the flutter video player plugin and maybe theres something we can extrapolate from that?

    opened by Taha-Firoz 0
  • Improve & fix error reporting

    Improve & fix error reporting

    I'm trying to load http://jewishmusic.fm/wp-content/uploads/secretmusicfolder1/singles/nissim-black-shiah-maisel---hope.mp3 and

    1. It's failing
    2. The failure is silent, so I'm not even sure why

    This is using the flutter example on windows

    Any help with this would be great, thanks!

    bug 
    opened by efraimbart 3
Releases(v0.0.3)
Owner
Harmonoid
🎡 An elegant music app. Running everywhere with same awesome experience. πŸ’œ
Harmonoid
A discord audio playback library in c++ with node bindings

Tokio This project is still WIP. C++ Discord library with node bindings focused on audio playback. The Core parts as networking with discord/audio dec

Liz3 2 Nov 17, 2021
Tenacity is an easy-to-use, cross-platform multi-track audio editor/recorder for Windows, MacOS, GNU/Linux

Tenacity is an easy-to-use, cross-platform multi-track audio editor/recorder for Windows, MacOS, GNU/Linux and other operating systems and is developed by a group of volunteers as open source software.

null 59 Jan 1, 2023
A tiny, header only, easy to use, cross-platform, portaudio wrapper, sound and notation manager, tailored for the demo scene.

TDAW A tiny, header only, easy to use, cross-platform, portaudio wrapper, sound and notation manager, tailored for the demo scene. This header enables

kbx 13 Dec 2, 2022
A next generation media player, with vim-like bindings

MusicKid A next generation media player, with vim-like bindings Installation Clone the repo git clone <git-url> cd MusicKid/Final Install dependencies

null 4 Jan 10, 2022
The Dolby MP4 streaming muxer (dlb_mp4base) is a software implementation of a muxer of fragmented or unfragmented ISO base media file format (mp4)

The Dolby MP4 streaming muxer (dlb_mp4base) is a software implementation of a muxer of fragmented or unfragmented ISO base media file format (mp4). It supports muxing of Dolby Digital (AC-3), Dolby Digital Plus (E-AC-3), and Dolby AC-4 audio formats as well as Dolby Vision.

Dolby Laboratories 203 Dec 21, 2022
The Dolby MP4 streaming demuxer (dlb_mp4demux) is a software implementation of a demuxer of fragmented or unfragmented ISO base media file format (mp4).

The Dolby MP4 streaming demuxer (dlb_mp4demux) is a software implementation of a demuxer of fragmented or unfragmented ISO base media file format (mp4). It supports demuxing of Dolby Digital (AC-3), Dolby Digital Plus (E-AC-3), and Dolby AC-4 audio formats as well as Dolby Vision. It is designed for use on architectures with limited resources.

Dolby Laboratories 68 Dec 20, 2022
Audacity fork without Telemetry and with new features

Searching for contributors! I'm currently searching for contributors as I can't keep up the project alone. If you're interested to become one, make an

Sartox 705 Jan 3, 2023
C library for cross-platform real-time audio input and output

libsoundio C library providing cross-platform audio input and output. The API is suitable for real-time software such as digital audio workstations as

Andrew Kelley 1.6k Jan 6, 2023
PortAudio is a portable audio I/O library designed for cross-platform support of audio

PortAudio is a cross-platform, open-source C language library for real-time audio input and output.

PortAudio 786 Jan 1, 2023
Cross-platform silk codec wrap library depends on ploverlake/silk.

libSilkCodec Cross-platform silk codec wrap library depends on ploverlake/silk. Clone & Build Linux/Unix like # clone $ git clone https://github.c

KonataDev 8 Sep 9, 2022
Cross platform C++11 library for decoding audio (mp3, wav, ogg, opus, flac, etc)

Libnyquist is a small C++11 library for reading sampled audio data from disk or memory. It is intended to be used an audio loading frontend for games, audio sequencers, music players, and more.

Dimitri Diakopoulos 442 Jan 2, 2023
projectM - cross-platform music visualization. Open-source and Milkdrop-compatible

projectM - cross-platform music visualization. Open-source and Milkdrop-compatible

projectM Visualizer 2.5k Dec 31, 2022
JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, RTAS and AAX audio plug-ins.

JUCE is an open-source cross-platform C++ application framework for creating high quality desktop and mobile applications, including VST, VST3, AU, AU

JUCE 4.7k Jan 6, 2023
Audacity is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems

Audacity is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems. Audacity is open source software licensed under GPL, version 2 or later.

Audacity 8.7k Dec 31, 2022
Sneedacity (formerly Audacity) is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems.

Sneedacity (formerly Audacity) is an easy-to-use, multi-track audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems. Sneedacity is open source software licensed under GPL, version 2 or later.

Sneed's Feed & Seed 874 Dec 30, 2022
eSpeak NG is a compact open source software text-to-speech synthesizer for Linux, Windows, Android and other operating systems

eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.

null 1.7k Jan 9, 2023
"Zero-copy" Linux screen capture plugin for OBS that uses libdrm and dmabuf

linux-kmsgrab plugin for OBS Introduction This plugin is a proof-of-concept libdrm-based screen capture for OBS. It uses DMA-BUF to import CRTC frameb

Ivan Avdeev 62 Dec 31, 2022
Linux client for Archo Music written in C++, uses Qt Framework.

ArchoMusicLinux Linux client for Archo Music written in C++, uses Qt Framework. For the original client, visit Archo Music Compiling Setting up the li

GianXD 2 Nov 13, 2021
An Audio-For-VATSIM ATC Client for macOs and Linux

An Audio-For-VATSIM ATC Client for macOs and Linux (audio only)

Pierre Ferran 27 Dec 27, 2022