Skip to content

Commit d3ca5ff

Browse files
authored
Merge pull request #6 from gam0022/experiments-sound
Experiments sound
2 parents f8942e0 + 99eb0c2 commit d3ca5ff

File tree

6 files changed

+355
-0
lines changed

6 files changed

+355
-0
lines changed

.idea/.idea.unity-demoscene/.idea/contentModel.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Experiments/Sound.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Experiments/Sound/Sound.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using UnityEngine;
5+
6+
public class Sound : MonoBehaviour
7+
{
8+
// Use this for initialization
9+
void Start()
10+
{
11+
int length = 600 * 100;
12+
var se = gameObject.AddComponent<AudioSource>();
13+
(se.clip = AudioClip.Create("test",length, 1, 44100, false))
14+
.SetData(Enumerable.Range(0, length).Select(t => Mathf.Sin(t * 0.05f)).ToArray(), 0);
15+
se.loop = true;
16+
se.Play();
17+
}
18+
19+
// Update is called once per frame
20+
void Update()
21+
{
22+
}
23+
}

Assets/Experiments/Sound/Sound.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Experiments/Sound/Sound.unity

Lines changed: 301 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,301 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!29 &1
4+
OcclusionCullingSettings:
5+
m_ObjectHideFlags: 0
6+
serializedVersion: 2
7+
m_OcclusionBakeSettings:
8+
smallestOccluder: 5
9+
smallestHole: 0.25
10+
backfaceThreshold: 100
11+
m_SceneGUID: 00000000000000000000000000000000
12+
m_OcclusionCullingData: {fileID: 0}
13+
--- !u!104 &2
14+
RenderSettings:
15+
m_ObjectHideFlags: 0
16+
serializedVersion: 9
17+
m_Fog: 0
18+
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
19+
m_FogMode: 3
20+
m_FogDensity: 0.01
21+
m_LinearFogStart: 0
22+
m_LinearFogEnd: 300
23+
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
24+
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
25+
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
26+
m_AmbientIntensity: 1
27+
m_AmbientMode: 0
28+
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
29+
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
30+
m_HaloStrength: 0.5
31+
m_FlareStrength: 1
32+
m_FlareFadeSpeed: 3
33+
m_HaloTexture: {fileID: 0}
34+
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
35+
m_DefaultReflectionMode: 0
36+
m_DefaultReflectionResolution: 128
37+
m_ReflectionBounces: 1
38+
m_ReflectionIntensity: 1
39+
m_CustomReflection: {fileID: 0}
40+
m_Sun: {fileID: 0}
41+
m_IndirectSpecularColor: {r: 0.44657826, g: 0.49641263, b: 0.57481676, a: 1}
42+
m_UseRadianceAmbientProbe: 0
43+
--- !u!157 &3
44+
LightmapSettings:
45+
m_ObjectHideFlags: 0
46+
serializedVersion: 11
47+
m_GIWorkflowMode: 0
48+
m_GISettings:
49+
serializedVersion: 2
50+
m_BounceScale: 1
51+
m_IndirectOutputScale: 1
52+
m_AlbedoBoost: 1
53+
m_TemporalCoherenceThreshold: 1
54+
m_EnvironmentLightingMode: 0
55+
m_EnableBakedLightmaps: 1
56+
m_EnableRealtimeLightmaps: 1
57+
m_LightmapEditorSettings:
58+
serializedVersion: 10
59+
m_Resolution: 2
60+
m_BakeResolution: 40
61+
m_AtlasSize: 1024
62+
m_AO: 0
63+
m_AOMaxDistance: 1
64+
m_CompAOExponent: 1
65+
m_CompAOExponentDirect: 0
66+
m_Padding: 2
67+
m_LightmapParameters: {fileID: 0}
68+
m_LightmapsBakeMode: 1
69+
m_TextureCompression: 1
70+
m_FinalGather: 0
71+
m_FinalGatherFiltering: 1
72+
m_FinalGatherRayCount: 256
73+
m_ReflectionCompression: 2
74+
m_MixedBakeMode: 2
75+
m_BakeBackend: 1
76+
m_PVRSampling: 1
77+
m_PVRDirectSampleCount: 32
78+
m_PVRSampleCount: 500
79+
m_PVRBounces: 2
80+
m_PVRFilterTypeDirect: 0
81+
m_PVRFilterTypeIndirect: 0
82+
m_PVRFilterTypeAO: 0
83+
m_PVRFilteringMode: 1
84+
m_PVRCulling: 1
85+
m_PVRFilteringGaussRadiusDirect: 1
86+
m_PVRFilteringGaussRadiusIndirect: 5
87+
m_PVRFilteringGaussRadiusAO: 2
88+
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
89+
m_PVRFilteringAtrousPositionSigmaIndirect: 2
90+
m_PVRFilteringAtrousPositionSigmaAO: 1
91+
m_ShowResolutionOverlay: 1
92+
m_LightingDataAsset: {fileID: 0}
93+
m_UseShadowmask: 1
94+
--- !u!196 &4
95+
NavMeshSettings:
96+
serializedVersion: 2
97+
m_ObjectHideFlags: 0
98+
m_BuildSettings:
99+
serializedVersion: 2
100+
agentTypeID: 0
101+
agentRadius: 0.5
102+
agentHeight: 2
103+
agentSlope: 45
104+
agentClimb: 0.4
105+
ledgeDropHeight: 0
106+
maxJumpAcrossDistance: 0
107+
minRegionArea: 2
108+
manualCellSize: 0
109+
cellSize: 0.16666667
110+
manualTileSize: 0
111+
tileSize: 256
112+
accuratePlacement: 0
113+
debug:
114+
m_Flags: 0
115+
m_NavMeshData: {fileID: 0}
116+
--- !u!1 &117859998
117+
GameObject:
118+
m_ObjectHideFlags: 0
119+
m_PrefabParentObject: {fileID: 0}
120+
m_PrefabInternal: {fileID: 0}
121+
serializedVersion: 5
122+
m_Component:
123+
- component: {fileID: 117860000}
124+
- component: {fileID: 117859999}
125+
m_Layer: 0
126+
m_Name: Directional Light
127+
m_TagString: Untagged
128+
m_Icon: {fileID: 0}
129+
m_NavMeshLayer: 0
130+
m_StaticEditorFlags: 0
131+
m_IsActive: 1
132+
--- !u!108 &117859999
133+
Light:
134+
m_ObjectHideFlags: 0
135+
m_PrefabParentObject: {fileID: 0}
136+
m_PrefabInternal: {fileID: 0}
137+
m_GameObject: {fileID: 117859998}
138+
m_Enabled: 1
139+
serializedVersion: 8
140+
m_Type: 1
141+
m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
142+
m_Intensity: 1
143+
m_Range: 10
144+
m_SpotAngle: 30
145+
m_CookieSize: 10
146+
m_Shadows:
147+
m_Type: 2
148+
m_Resolution: -1
149+
m_CustomResolution: -1
150+
m_Strength: 1
151+
m_Bias: 0.05
152+
m_NormalBias: 0.4
153+
m_NearPlane: 0.2
154+
m_Cookie: {fileID: 0}
155+
m_DrawHalo: 0
156+
m_Flare: {fileID: 0}
157+
m_RenderMode: 0
158+
m_CullingMask:
159+
serializedVersion: 2
160+
m_Bits: 4294967295
161+
m_Lightmapping: 4
162+
m_AreaSize: {x: 1, y: 1}
163+
m_BounceIntensity: 1
164+
m_ColorTemperature: 6570
165+
m_UseColorTemperature: 0
166+
m_ShadowRadius: 0
167+
m_ShadowAngle: 0
168+
--- !u!4 &117860000
169+
Transform:
170+
m_ObjectHideFlags: 0
171+
m_PrefabParentObject: {fileID: 0}
172+
m_PrefabInternal: {fileID: 0}
173+
m_GameObject: {fileID: 117859998}
174+
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
175+
m_LocalPosition: {x: 0, y: 3, z: 0}
176+
m_LocalScale: {x: 1, y: 1, z: 1}
177+
m_Children: []
178+
m_Father: {fileID: 0}
179+
m_RootOrder: 1
180+
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
181+
--- !u!1 &687299509
182+
GameObject:
183+
m_ObjectHideFlags: 0
184+
m_PrefabParentObject: {fileID: 0}
185+
m_PrefabInternal: {fileID: 0}
186+
serializedVersion: 5
187+
m_Component:
188+
- component: {fileID: 687299513}
189+
- component: {fileID: 687299512}
190+
- component: {fileID: 687299511}
191+
- component: {fileID: 687299510}
192+
m_Layer: 0
193+
m_Name: Main Camera
194+
m_TagString: MainCamera
195+
m_Icon: {fileID: 0}
196+
m_NavMeshLayer: 0
197+
m_StaticEditorFlags: 0
198+
m_IsActive: 1
199+
--- !u!81 &687299510
200+
AudioListener:
201+
m_ObjectHideFlags: 0
202+
m_PrefabParentObject: {fileID: 0}
203+
m_PrefabInternal: {fileID: 0}
204+
m_GameObject: {fileID: 687299509}
205+
m_Enabled: 1
206+
--- !u!124 &687299511
207+
Behaviour:
208+
m_ObjectHideFlags: 0
209+
m_PrefabParentObject: {fileID: 0}
210+
m_PrefabInternal: {fileID: 0}
211+
m_GameObject: {fileID: 687299509}
212+
m_Enabled: 1
213+
--- !u!20 &687299512
214+
Camera:
215+
m_ObjectHideFlags: 0
216+
m_PrefabParentObject: {fileID: 0}
217+
m_PrefabInternal: {fileID: 0}
218+
m_GameObject: {fileID: 687299509}
219+
m_Enabled: 1
220+
serializedVersion: 2
221+
m_ClearFlags: 1
222+
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
223+
m_NormalizedViewPortRect:
224+
serializedVersion: 2
225+
x: 0
226+
y: 0
227+
width: 1
228+
height: 1
229+
near clip plane: 0.3
230+
far clip plane: 1000
231+
field of view: 60
232+
orthographic: 0
233+
orthographic size: 5
234+
m_Depth: -1
235+
m_CullingMask:
236+
serializedVersion: 2
237+
m_Bits: 4294967295
238+
m_RenderingPath: -1
239+
m_TargetTexture: {fileID: 0}
240+
m_TargetDisplay: 0
241+
m_TargetEye: 3
242+
m_HDR: 1
243+
m_AllowMSAA: 1
244+
m_AllowDynamicResolution: 0
245+
m_ForceIntoRT: 0
246+
m_OcclusionCulling: 1
247+
m_StereoConvergence: 10
248+
m_StereoSeparation: 0.022
249+
--- !u!4 &687299513
250+
Transform:
251+
m_ObjectHideFlags: 0
252+
m_PrefabParentObject: {fileID: 0}
253+
m_PrefabInternal: {fileID: 0}
254+
m_GameObject: {fileID: 687299509}
255+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
256+
m_LocalPosition: {x: 0, y: 1, z: -10}
257+
m_LocalScale: {x: 1, y: 1, z: 1}
258+
m_Children: []
259+
m_Father: {fileID: 0}
260+
m_RootOrder: 0
261+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
262+
--- !u!1 &1159427093
263+
GameObject:
264+
m_ObjectHideFlags: 0
265+
m_PrefabParentObject: {fileID: 0}
266+
m_PrefabInternal: {fileID: 0}
267+
serializedVersion: 5
268+
m_Component:
269+
- component: {fileID: 1159427095}
270+
- component: {fileID: 1159427094}
271+
m_Layer: 0
272+
m_Name: Director
273+
m_TagString: Untagged
274+
m_Icon: {fileID: 0}
275+
m_NavMeshLayer: 0
276+
m_StaticEditorFlags: 0
277+
m_IsActive: 1
278+
--- !u!114 &1159427094
279+
MonoBehaviour:
280+
m_ObjectHideFlags: 0
281+
m_PrefabParentObject: {fileID: 0}
282+
m_PrefabInternal: {fileID: 0}
283+
m_GameObject: {fileID: 1159427093}
284+
m_Enabled: 1
285+
m_EditorHideFlags: 0
286+
m_Script: {fileID: 11500000, guid: f10e6168864c6de489e06583fc86b424, type: 3}
287+
m_Name:
288+
m_EditorClassIdentifier:
289+
--- !u!4 &1159427095
290+
Transform:
291+
m_ObjectHideFlags: 0
292+
m_PrefabParentObject: {fileID: 0}
293+
m_PrefabInternal: {fileID: 0}
294+
m_GameObject: {fileID: 1159427093}
295+
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
296+
m_LocalPosition: {x: -0.17524518, y: 1.558925, z: -4.509098}
297+
m_LocalScale: {x: 1, y: 1, z: 1}
298+
m_Children: []
299+
m_Father: {fileID: 0}
300+
m_RootOrder: 2
301+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

Assets/Experiments/Sound/Sound.unity.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)