Audio widget accept Byte / Numpy data (request) #351
Labels
good first issue
Good for newcomers
sprintable
type: enhancement
Minor feature or improvement to an existing feature
Projects
Background
With the pull request of #215 , Panel supports an Python callable audio widget. However, it seems artificially limited to accepting only a String with a path to an audio file when setting "value". Please allow other data as well, to make it more comparable functionality-wise with the Jupyter Notebook Audio widget.
Attempt
I've been giving an attempt myself, but I'm too unfamiliar with the code base of Panel. This was resulting in errors:
At first I was trying to change msg['value'] directly, but I don't know how to extend the String check to also accept Byte/Numpy data. Then I tried to add an additional attribute, but that gave me:
AttributeError: unexpected attribute 'data_array' to Audio
.Reuse IPython code
Since IPython is also BSD licensed, some code from here could be reused: https://github.com/ipython/ipython/blob/08aaa2e197a34dc820e7fef32b473d24b4547630/IPython/lib/display.py
Extra
Would be nice if you can pass in a String to audio file or audio data without using a named argument.
The text was updated successfully, but these errors were encountered: