I want to play music in my Matlab game, how can I play one?

5 visualizaciones (últimos 30 días)
I am looking to put music in a Matlab game using the occasional song I have saved, however I do not have the slightest idea if it is even possible. Could someone solve this big question?

Respuesta aceptada

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH el 12 de Nov. de 2019
yes, you can do it, try it :
load handel
sound(y,Fs)
you can play a file using the following command :
[y,Fs] = audioread('nombredearchivo.extension')
sound(y,Fs)
  1 comentario
Mauricio  García Garza
Mauricio García Garza el 12 de Nov. de 2019
I guess the file should be inside the MatLab folder, right? By the way, thank you! Now I have a slight doubt, how could I link it to the beginning of the game ?, Since I would like the following: "When the player presses Start, the music starts running"

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Just for fun en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by