Comments (7)
I followed the rich output example, and it works for me.
from IPython.display import Audio
Audio(url="http://www.nch.com.au/acm/8k16bitpcm.wav")
This one generates 2 sine waves.
import numpy as np
max_time = 3
f1 = 220.0
f2 = 224.0
rate = 8000.0
L = 3
times = np.linspace(0,L,rate*L)
signal = np.sin(2*np.pi*f1*times) + np.sin(2*np.pi*f2*times)
Audio(data=signal, rate=rate)
from colabtools.
I have tried and found 2 methods to play midi in Colab.
The simpler one is to convert midi to wav as in this gist.
Another one use midi.js to play midi file directly.
See my "unorganized" notebook. (a few failures with other methods)
https://colab.research.google.com/drive/1iliUIN1Jn8552XEiYBYEYimSm7yiOJ8x
from colabtools.
How do we play sound using numpy data through python file on Notebook in google colab?
from colabtools.
Hi,
I still struggle to play a midi file in a colaboratory notebook. All the examples i found so far are jupyter notebooks (with music21 for example) that require the installation of some additional programs like musescore etc. on the local machine to play the midi files. These notebooks did not work in the colaboratory environment.
Has anybody succeeded to play a midi-file in the colaboratory environment? It would be nice to see such a notebook (with all the required installation steps apt-get...).
from colabtools.
This is great! With your code i was able to play a midi file (i.e. convert to wav and show it in the notebook) like this:
!apt install fluidsynth
!cp /usr/share/sounds/sf2/FluidR3_GM.sf2 ./font.sf2
!pip install midi2audio
from midi2audio import FluidSynth
from IPython.display import Audio
FluidSynth("font.sf2").midi_to_audio('test.midi', 'test.wav')
Audio("test.wav")
Thanks a lot!
from colabtools.
thanks this really helped :)
from colabtools.
This really works. Thanks so much!
from colabtools.
Related Issues (20)
- Variables are not being exchanged for their values when used as an argument in a script HOT 3
- Notebook for Text Classification with Movie Reviews is missing
- Cannot update to latest ggplot2 version in colab R kernel HOT 3
- I purchased 100 computing units and I'm not able to use them
- Google Colab consumed the compute units without running a notebook in premium account. HOT 1
- calculator.py
- Error when starting "Start Stable-Diffusion" while "fast_stable_diffusion" is running etc...
- Error when starting "Start Stable-Diffusion" while "fast_stable_diffusion" is running etc... HOT 1
- whisper-webui.ipynb error HOT 1
- problems colab HOT 1
- Avoid popping the custom widgets snippet for local runtimes HOT 3
- Syntax Highlighting not available completely.
- Vertical Ruler Not Visible Anymore
- Your session crashed for an unknown reason HOT 1
- Add DuckDB backend for Ibis HOT 1
- swapfile using swapon shows on examples as an option but the environment does not allow swapon to work. The message is: Setting up swapspace version 1, size = 64 GiB (68719472640 bytes) no label, UUID=1a6000c4-9304-499e-bd43-fcaafb8bacf0 swapon: /content/swapfile: found signature [pagesize=4096, signature=swap] swapon: /content/swapfile: pagesize=4096, swapsize=68719476736, devsize=68719476736 swapon /content/swapfile swapon: /content/swapfile: swapon failed: Operation not permitted total used free shared buff/cache available Mem: 50Gi 1.6Gi 32Gi 2.0Mi 17Gi 48Gi Swap: 0B 0B 0B HOT 1
- Error Installing Dependencies on Google Colab (Wheel) HOT 1
- Sidebar keeps popping open even when I don't click on it HOT 1
- [BUG]Colab,Could not create share link. HOT 3
- Los archivos de google drive no se actualizan como deben HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from colabtools.