mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Remove loop detection code for now.
This needs a rethink. My test is no longer looping. Needs further investigation.
This commit is contained in:
@@ -83,17 +83,17 @@ int main(int argc, char** argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
result = ma_node_attach_output_bus(&g_dataSourceNode, 0, ma_node_graph_get_endpoint(&g_nodeGraph), 0);
|
||||
/*result = ma_node_attach_output_bus(&g_dataSourceNode, 0, ma_node_graph_get_endpoint(&g_nodeGraph), 0);
|
||||
if (result != MA_SUCCESS) {
|
||||
printf("Failed to attach node.");
|
||||
return -1;
|
||||
}
|
||||
}*/
|
||||
|
||||
/*ma_node_set_state_time(&g_dataSourceNode, ma_node_state_started, 48000*1);
|
||||
ma_node_set_state_time(&g_dataSourceNode, ma_node_state_stopped, 48000*5);*/
|
||||
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
/*
|
||||
Splitter node. Note that we've already attached the data source node to another, so this section
|
||||
will test that changing of attachments works as expected.
|
||||
@@ -109,13 +109,9 @@ int main(int argc, char** argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Connect both outputs of the splitter to the endpoint for now. Later on we'll test effects and whatnot. */
|
||||
ma_node_attach_output_bus(&g_loopNode, 0, ma_node_graph_get_endpoint(&g_nodeGraph), 0);
|
||||
ma_node_attach_output_bus(&g_loopNode, 1, ma_node_graph_get_endpoint(&g_nodeGraph), 0);
|
||||
|
||||
/* Adjust the volume of the splitter node's endpoints. We'll just do it 50/50 so that both of them combine to reproduce the original signal at the endpoint. */
|
||||
ma_node_set_output_bus_volume(&g_loopNode, 0, 0.5f);
|
||||
ma_node_set_output_bus_volume(&g_loopNode, 1, 0.5f);
|
||||
ma_node_set_output_bus_volume(&g_loopNode, 0, 1.0f);
|
||||
ma_node_set_output_bus_volume(&g_loopNode, 1, 1.0f);
|
||||
|
||||
|
||||
|
||||
@@ -135,17 +131,26 @@ int main(int argc, char** argv)
|
||||
/* Adjust the volume of the splitter node's endpoints. We'll just do it 50/50 so that both of them combine to reproduce the original signal at the endpoint. */
|
||||
ma_node_set_output_bus_volume(&g_splitterNode, 0, 0.5f);
|
||||
ma_node_set_output_bus_volume(&g_splitterNode, 1, 0.5f);
|
||||
#else
|
||||
/* Connect both outputs of the splitter to the endpoint for now. Later on we'll test effects and whatnot. */
|
||||
ma_node_attach_output_bus(&g_splitterNode, 0, &g_loopNode, 0);
|
||||
ma_node_attach_output_bus(&g_splitterNode, 1, &g_loopNode, 1);
|
||||
|
||||
/* Now loop back to the splitter node to form a loop. */
|
||||
/*ma_node_attach_output_bus(&g_loopNode, 1, &g_splitterNode, 0);*/
|
||||
#endif
|
||||
|
||||
/* The data source needs to have it's connection changed from the endpoint to the splitter. */
|
||||
ma_node_attach_output_bus(&g_dataSourceNode, 0, &g_splitterNode, 0);
|
||||
#else
|
||||
/* Connect the loop node directly to the output. */
|
||||
ma_node_attach_output_bus(&g_loopNode, 0, ma_node_graph_get_endpoint(&g_nodeGraph), 0);
|
||||
ma_node_attach_output_bus(&g_loopNode, 1, ma_node_graph_get_endpoint(&g_nodeGraph), 0);
|
||||
|
||||
/* Connect the splitter node directly to the loop node. */
|
||||
ma_node_attach_output_bus(&g_splitterNode, 0, &g_loopNode, 0);
|
||||
ma_node_attach_output_bus(&g_splitterNode, 1, &g_loopNode, 1);
|
||||
|
||||
/* Connect the data source node to the splitter node. */
|
||||
ma_node_attach_output_bus(&g_dataSourceNode, 0, &g_splitterNode, 0);
|
||||
|
||||
/* Now loop back to the splitter node to form a loop. */
|
||||
ma_node_attach_output_bus(&g_loopNode, 1, &g_splitterNode, 0);
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user