{"id":1050,"date":"2018-05-10T01:37:08","date_gmt":"2018-05-10T01:37:08","guid":{"rendered":"http:\/\/procedural-audio.com\/blog\/?p=1050"},"modified":"2022-01-06T10:45:26","modified_gmt":"2022-01-06T10:45:26","slug":"exporting-sounds-to-unity","status":"publish","type":"post","link":"http:\/\/procedural-audio.com\/blog\/2018\/05\/10\/exporting-sounds-to-unity\/","title":{"rendered":"Exporting Sounds to Unity"},"content":{"rendered":"<p><a href=\"http:\/\/procedural-audio.com\/web\/en\/products-gamesynth.html\" target=\"_blank\" rel=\"noopener\">GameSynth<\/a> makes it incredibly <strong>easy to generate many variations of a sound effect and to add them to your Unity project<\/strong>, automatically importing the wave files, creating the corresponding metafiles, setting the audio parameters according to your specifications, and even writing a script so that the sound variations can be played in different ways (randomly, sequentially etc.).<br \/>\n&nbsp;<br \/>\nDo you want to add 20 sword sounds, 150 impacts or 1000 whooshes to your Unity project?\u00a0 Once you have edited your procedural audio patch in GameSynth and assigned some random ranges (check <a href=\"http:\/\/procedural-audio.com\/blog\/2018\/03\/15\/creating-sound-variations-in-gamesynth\/\" target=\"_blank\" rel=\"noopener\">this previous post<\/a> to see how easy it is), click on the \u201cExport\u201d button in the command panel. At the top of the window that appears, in the \u201cTarget\u201d section, select Unity as the middleware, and specify the resources folder of the destination project.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-1054\" src=\"http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/05\/0001.png\" alt=\"0001\" width=\"771\" height=\"558\" srcset=\"http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/05\/0001.png 771w, http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/05\/0001-150x109.png 150w, http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/05\/0001-300x217.png 300w, http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/05\/0001-768x556.png 768w\" sizes=\"(max-width: 771px) 100vw, 771px\" \/><\/p>\n<p>In the \u201cSample files\u201d section, you can then enter how many sounds you want to generate from your patch, the amount of variation, the number channels they should have as well as how the files should be named. In the example depicted above, we are asking GameSynth to generate 20 sounds with a variation of 30%. They will be mono and since the base name is set to \u201cImpact\u201d and the starting index to 0, they will be named \u201cImpact_0.wav\u201d to \u201cImpact_29.wav\u201d.<br \/>\n&nbsp;<br \/>\nThe next section allows you to specify the resource settings, such as the loading type, the compression format, preloading, normalization and more. These will be saved in the .meta files that GameSynth will generate automatically and add to the resources folder of your Unity project, along with the wave files.<br \/>\n&nbsp;<br \/>\nCheck the following video to see how simple and fast it is to create new sounds and add them to your Unity project.<\/p>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/tPZHGehVjlY?rel=0\" frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen><\/iframe><\/p>\n<p>As you can see in the video above, GameSynth can also generate a script &#8211; in C# or JavaScript &#8211; that will implement the playback of the sounds. This script can be used as a starting point and customized based on the actual requirements of your game. However, it already allows for some interesting behaviours. For example, when you generate several sounds, it will be possible to specify how they will be selected during playback. Three modes are available: sequential, shuffle (i.e. random with no repetitions) and totally random. In addition, the playback volume and pitch can also be randomized, as shown below.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"470\" height=\"138\" class=\"alignnone size-full wp-image-1055\" src=\"http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/05\/0002.png\" alt=\"0002\" style=\"max-width: 390px;\" srcset=\"http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/05\/0002.png 470w, http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/05\/0002-150x44.png 150w, http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2018\/05\/0002-300x88.png 300w\" sizes=\"(max-width: 470px) 100vw, 470px\" \/><\/p>\n<p>The audio export to Unity is quite a unique feature offered by GameSynth, one that will make your audio implementation work much smoother!<\/p>\n<p><a class=\"gs-learn-more\" href=\"http:\/\/procedural-audio.com\/web\/en\/products-gamesynth.html\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"http:\/\/procedural-audio.com\/blog\/wp-content\/uploads\/2020\/06\/2020_06_Introducing-Modular-Weapons-Modules-banner-1.png\" alt=\"GameSynth\"><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>GameSynth makes it incredibly easy to generate many variations of a sound effect and to add them to your Unity project, automatically importing the<\/p>\n","protected":false},"author":1,"featured_media":1062,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6,15,12],"tags":[],"_links":{"self":[{"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/posts\/1050"}],"collection":[{"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/comments?post=1050"}],"version-history":[{"count":10,"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/posts\/1050\/revisions"}],"predecessor-version":[{"id":4966,"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/posts\/1050\/revisions\/4966"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/media\/1062"}],"wp:attachment":[{"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/media?parent=1050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/categories?post=1050"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/procedural-audio.com\/blog\/wp-json\/wp\/v2\/tags?post=1050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}