stefh / howler.blazor Goto Github PK
View Code? Open in Web Editor NEWA Blazor JSInterop wrapper for Howler.js.
License: MIT License
A Blazor JSInterop wrapper for Howler.js.
License: MIT License
I'm storing the audio files locally in the client with indexeddb as base64 string but I can't figure out how to feed in the Howl the audio data, what I use to make it ingest such data correctly?
Thanks for creating this wrapper. Its super easy to use. Any plans on implemented the howler rate method for changing the playback rate? I can submit a PR for it but didn't want to duplicate work in case you already had plans for it.
Also, I created a reusable audio player component out of your example that includes a progress bar and timer. I can do a PR for that as well if you like.
Calling Howl.Seek(TimeSpan)
does not seek to the expected position - instead, it essentially restarts the audio clip from the beginning.
I believe that the code below should use position.TotalMilliseconds
rather than position.TotalSeconds
?
public ValueTask Seek(int soundId, TimeSpan position)
{
return _runtime.InvokeVoidAsync("howl.seek", soundId, position.TotalSeconds);
}
Hi,
Thanks for this great component. I love the simplicity of integrating it.
I'm getting an error when trying to play an mp3 file from azure storage. Here's the Url:
https://lookandstore.blob.core.windows.net/863da396-6e44-4b3b-8db1-e447d87b121f/instrumental_mp3_637141046337946343_99lfo/instrumental_mp3?sv=2018-03-28&sr=b&sig=96LJ7bycF3lrtiWbVP5tK6%2BOOIJKfq7eYPO%2FjOT72ns%3D&se=2022-10-04T18%3A23%3A53Z&sp=rl
This fails with the error below. I confirmed the file is downloadable and other online players can access it. My sample also works with the urls in Any clues on how to fix this?
Error:
System.Text.Json.JsonException: The JSON value could not be converted to System.Int32. Path: $ | LineNumber: 0 | BytePositionInLine: 4. ---> System.InvalidOperationException: Cannot get the value of a token type 'Null' as a number.
at System.Text.Json.Utf8JsonReader.TryGetInt32 (System.Int32& value) <0x2136d28 + 0x0001a> in :0
at System.Text.Json.Utf8JsonReader.GetInt32 () <0x2136c58 + 0x00008> in :0
at System.Text.Json.Serialization.Converters.JsonConverterInt32.Read (System.Text.Json.Utf8JsonReader& reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) <0x2136ba8 + 0x00004> in :0
at System.Text.Json.JsonPropertyInfoNotNullable`4[TClass,TDeclaredProperty,TRuntimeProperty,TConverter].OnRead (System.Text.Json.ReadStack& state, System.Text.Json.Utf8JsonReader& reader) <0x21b23f8 + 0x00032> in :0
at System.Text.Json.JsonPropertyInfo.Read (System.Text.Json.JsonTokenType tokenType, System.Text.Json.ReadStack& state, System.Text.Json.Utf8JsonReader& reader) <0x1edbe28 + 0x0007e> in :0
at System.Text.Json.JsonSerializer.HandleNull (System.Text.Json.Utf8JsonReader& reader, System.Text.Json.ReadStack& state) <0x2145490 + 0x00108> in :0
at System.Text.Json.JsonSerializer.ReadCore (System.Text.Json.JsonSerializerOptions options, System.Text.Json.Utf8JsonReader& reader, System.Text.Json.ReadStack& readStack) <0x1ec3e20 + 0x00274> in :0
--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath (System.Text.Json.ReadStack& readStack, System.Text.Json.Utf8JsonReader& reader, System.Exception ex) <0x22043b8 + 0x00028> in :0
at System.Text.Json.JsonSerializer.ReadCore (System.Text.Json.JsonSerializerOptions options, System.Text.Json.Utf8JsonReader& reader, System.Text.Json.ReadStack& readStack) <0x1ec3e20 + 0x0032a> in :0
at System.Text.Json.JsonSerializer.ReadValueCore (System.Text.Json.JsonSerializerOptions options, System.Text.Json.Utf8JsonReader& reader, System.Text.Json.ReadStack& readStack) <0x207ccb8 + 0x00546> in :0
at System.Text.Json.JsonSerializer.ReadValueCore (System.Text.Json.Utf8JsonReader& reader, System.Type returnType, System.Text.Json.JsonSerializerOptions options) <0x207c210 + 0x0003e> in :0
at System.Text.Json.JsonSerializer.Deserialize (System.Text.Json.Utf8JsonReader& reader, System.Type returnType, System.Text.Json.JsonSerializerOptions options) <0x207c130 + 0x00024> in :0
at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.ParseArguments (Microsoft.JSInterop.JSRuntime jsRuntime, System.String methodIdentifier, System.String arguments, System.Type[] parameterTypes) <0x210a648 + 0x0015c> in <3eedf0ca90ca4e72bf6870618ca98c7c>:0
at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.InvokeSynchronously (Microsoft.JSInterop.JSRuntime jsRuntime, Microsoft.JSInterop.Infrastructure.DotNetInvocationInfo& callInfo, Microsoft.JSInterop.Infrastructure.IDotNetObjectReference objectReference, System.String argsJson) <0x20d2120 + 0x00108> in <3eedf0ca90ca4e72bf6870618ca98c7c>:0
at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.BeginInvokeDotNet (Microsoft.JSInterop.JSRuntime jsRuntime, Microsoft.JSInterop.Infrastructure.DotNetInvocationInfo invocationInfo, System.String argsJson) <0x20d1c90 + 0x00092> in <3eedf0ca90ca4e72bf6870618ca98c7c>:0
at Object.endInvokeDotNetFromJS (https://localhost:44314/_framework/blazor.webassembly.js:1:9849)
at Object.invokeJSFromDotNet (https://localhost:44314/_framework/blazor.webassembly.js:1:9475)
at _mono_wasm_invoke_js_marshalled (https://localhost:44314/_framework/wasm/mono.js:1:165750)
at wasm-function[6221]:0x11936a
at wasm-function[1431]:0x402ee
at wasm-function[636]:0x147cf
at wasm-function[4996]:0xeb135
at wasm-function[3247]:0xa0666
at wasm-function[1324]:0x3af33
at wasm-function[436]:0xd450
I would like to propose exposing
https://github.com/goldfire/howler.js#volume-number-10
in
src/Howler.Blazor/Components/HowlOptions.cs
as double? in order to have better control on how multiple sounds are played.
Hi,
Please add record if possible.
Thanks!
I would like to have the current total time of an audio file, even when it is not played (and has never been played). Is it possible to grab some metadata when the file has been loaded?
I use your framework inside a blazor application (https://github.com/NeoCoderMatrix86/AudioCuesheetEditor) for editing cuesheets.
If I record some ogg/opus inside the application and play that record with your framework, I get an exception like this:
System.Text.Json.JsonException: The JSON value could not be converted to System.Int32. Path: $ | LineNumber: 0 | BytePositionInLine: 4.
---> System.InvalidOperationException: Cannot get the value of a token type 'Null' as a number.
at System.Text.Json.Utf8JsonReader.TryGetInt32(Int32& value)
at System.Text.Json.Utf8JsonReader.GetInt32()
at System.Text.Json.Serialization.Converters.Int32Converter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
at System.Text.Json.Serialization.JsonConverter`1[[System.Int32, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, Int32& value)
at System.Text.Json.Serialization.JsonConverter`1[[System.Int32, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex)
at System.Text.Json.Serialization.JsonConverter`1[[System.Int32, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.Serialization.JsonConverter`1[[System.Int32, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].ReadCoreAsObject(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadCore[Object](JsonConverter jsonConverter, Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadValueCore[Object](JsonSerializerOptions options, Utf8JsonReader& reader, ReadStack& state)
at System.Text.Json.JsonSerializer.Deserialize(Utf8JsonReader& reader, Type returnType, JsonSerializerOptions options)
at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.ParseArguments(JSRuntime jsRuntime, String methodIdentifier, String arguments, Type[] parameterTypes)
at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.InvokeSynchronously(JSRuntime jsRuntime, DotNetInvocationInfo& callInfo, IDotNetObjectReference objectReference, String argsJson)
at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.BeginInvokeDotNet(JSRuntime jsRuntime, DotNetInvocationInfo invocationInfo, String argsJson)
Could You Please Add Recording functionalities.
Thanks!
I have a app on RaspberryPi,
how can i play local files?
my files are in storage and i play it with bass.dll on rpi,
but i will play on client side:
this i my data-string:
"/media/New Rock Party/1The 80s.mp3"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.