User Tools

Site Tools


en:tutorials:audio:sound

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:tutorials:audio:sound [2012/03/01 10:28 (11 years ago)]
zera [Summary]
en:tutorials:audio:sound [2020/08/31 08:31 (24 months ago)] (current)
40.77.167.232 ↷ Links adapted because of a move operation
Line 3: Line 3:
 ===== Summary ===== ===== Summary =====
  
-Ver los anteriores ​[[main#Basic|tutoriales básicos]] para más información sobre la [[object|creación básica de objetos]], [[clock|manejo del reloj]], [[frame|jerarquía de fotogramas]], [[anim|animaciones]] [[viewport|cámaras ​vistas]].+See previous basic tutorials for more info about basic [[..:​objects:​object|object ​creation]], [[..:clocks:clock|clock handling]], [[..:objects:frame|frames hierarchy]], [[..:​animation:​anim|animations]] and [[..:​viewport:​viewport|cameras ​viewports]].
  
-Este tutorial ​muestra como reproducir sonidos(muestrasy músicas(streams).\\ +This tutorial ​shows how to play sounds ​(samplesand musics ​(streams).\\ 
-Como con otras características de comportamientos anterioressolo se requierela mayoría de las vecesuna sola linea de código, para empezar ​manejar todos los datos.\\ +As with other features from previous behaviorit only requiresmost of the time, a single line of code, everything being data driven.\\ 
-Este tutorial ​también demuestra como alterar las configuraciones del sonido en tiempo ​real, usando el gráfico del soldado como retroalimentación ​visual.+This tutorial ​also demonstrates how to alter sound settings in real timeusing the soldier graphic as a visual ​feedback.
  
-Si tu presionas las flechas arriba ​abajoel volumen de la música cambiará acordementeEl soldado se escalará como consecuencia.\\ +If you press up down arrowsthe music volume will change accordinglyThe soldier will be scale in consequence.\\ 
-Por presionar las flechas izquierda ​derechael tono de la música(frecuenciacambiaráEl soldado rotara como una perilla+By pressing left right arrowsthe music pitch (frequencywill changeThe soldier will rotate like a knob.\\ 
-La tecla Control Izquierda reproducirá la música(y activará el soldadosi la música fue pausadade otra manera pausará la música(y desactivará el soldado).\\  +Left control key will play the music (and activate the soldierif the music was pausedotherwise it'll pause the music (and deactivate the soldier).\\ 
-El efecto de sonido de la tecla Espacio presionada es la misma que Enterexcepto, de que su volumen y tono son aleatoriamente definidos en fichero de configuración por defecto.+Lastlyenter and space will play a sound effect on the soldier.\\ 
 +Space triggered sound effect is the same as enter except that its volume and pitch are randomly defined in the default config file.
  
-Esta aleatoriedad de la frecuencia controlada en la configuración permite fácilmente generar de paso o golpeo de sonido con ligeras variaciones con ninguna linea adicional de código.\\ +This config-controlled frequency randomness allows to easily generate step or hit sounds with slight variations with no extra line of code.\\ 
-Cambiamos aleatoriamente el color del soldado para ilustrar esto.\\ +We randomly change the soldier'​s ​color to illustrate this.\\ 
-El efecto de sonido solo se añadirá y reproducirá con el soldado activo.\\ +The sound effect will only be added and played on an active soldier.\\ 
-Si tu quieres reproducir un efecto de  sonido sin ningun objeto como soportetu lo puedes hacer de la misma manera que creamos la música en este tutorial.\\ +If you want to play a sound effect with no object as supportyou can do it the same way we create the music in this tutorial.\\ 
-Sin embargoreproduciendo un sonido en un objecto permitiría posicionar el sonido espacialmente(no cubierto en este tutorial).+Howeverplaying a sound on an object will allow spatial sound positioning ​(not covered by this tutorial).
  
-Muchos efectos de sonido pueden ser reproducidos al mismo tiempo en un solo objeto.+Many sound effects can be played at the same time on a single object.
  
-El atributo ''​KeepDataInCache''​ de configuración del sonido permite mantener la muestra de sonido en la memoria en de releerlo del fichero constantemente+The sound config attribute ​KeepDataInCache ​allows to keep the sound sample in memory instead of rereading it from file every time.\\ 
-Esto solo funciona para datos no-stream(ejNo para música).\\ +This only works for non-streamed data (ienot for musics).\\ 
-Si esto fuera falsola muestra será recargada desde ficheroa menos que no haya otro efecto de sonido del mismo tipo que esté siendo reproducido.+If it's set to falsethe sample will be reloaded from fileunless there'​s currently another sound effect of the same type being played.
  
-También registramos los eventos de sonidos para mostrar cuando los efectos de sonidos son reproducidos y detenidos.\\ +We also register to the sound events to display when sound effects are played and stopped.\\ 
-Estos eventos son solo enviados por efectos de sonido reproducidos en objetos.+These events are only sent for sound effects played on objects.
  
 ===== Details ===== ===== Details =====
  
-As usual, we begin by loading our config file, getting the main clock and registering our ''​Update''​ function to it and, lastly, by creating our soldier object.\\ +As usual, we begin by creating a viewport, getting the main clock and registering our ''​Update''​ function to it and, lastly, by creating our soldier object.\\ 
-Please refer to the [[main#​Basic|previous tutorials]] for more details.+Please refer to the previous tutorials for more details.
  
 We then create a music and play it. We then create a music and play it.
Line 109: Line 110:
 This simple code, when activating the input ''​ToggleMusic'',​ will either start the music and activate our soldier if the music was not playing or, on the contrary, will stop it and deactivate our soldier if the music was playing. This simple code, when activating the input ''​ToggleMusic'',​ will either start the music and activate our soldier if the music was not playing or, on the contrary, will stop it and deactivate our soldier if the music was playing.
  
-Now, let'​s ​can change the pitch.+Now, let's change the pitch.
  
 <code c>​if(orxInput_IsActive("​PitchUp"​)) <code c>​if(orxInput_IsActive("​PitchUp"​))
Line 129: Line 130:
 Same as for the pitch, nothing unusual. Same as for the pitch, nothing unusual.
  
-//NB: We can notice that only our object rotation will be time-consistent (cf. [[clock|clock tutorial]]).\\+//NB: We can notice that only our object rotation will be time-consistent (cf. [[..:clocks:clock|clock tutorial]]).\\
 The music'​s pitch and volume, as well as the object'​s scale will be framerate-dependent,​ which is a bad idea.\\ The music'​s pitch and volume, as well as the object'​s scale will be framerate-dependent,​ which is a bad idea.\\
 To fix this we'd only need to use the clock'​s DT to ponderate the given values.// To fix this we'd only need to use the clock'​s DT to ponderate the given values.//
Line 167: Line 168:
 ===== Resources ===== ===== Resources =====
  
-Source code: [[https://orx.svn.sourceforge.net/svnroot/orx/trunk/​tutorial/​src/06_Sound/​06_Sound.c|06_Sound.c]] +Source code: [[https://github.com/orx/orx/blob/master/​tutorial/​src/​06_Sound.c|06_Sound.c]]
- +
-Config file: [[https://​orx.svn.sourceforge.net/​svnroot/​orx/​trunk/​tutorial/​bin/​06_Sound.ini|06_Sound.ini]]+
  
 +Config file: [[https://​github.com/​orx/​orx/​blob/​master/​tutorial/​bin/​06_Sound.ini|06_Sound.ini]]
en/tutorials/audio/sound.1330626482.txt.gz · Last modified: 2017/05/30 00:50 (5 years ago) (external edit)