Add audio::mix helper function
This commit is contained in:
parent
5e93208fcb
commit
292ccadc7e
2 changed files with 11 additions and 0 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
#include <psemek/audio/channel.hpp>
|
#include <psemek/audio/channel.hpp>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace psemek::audio
|
namespace psemek::audio
|
||||||
{
|
{
|
||||||
|
|
@ -18,4 +19,6 @@ namespace psemek::audio
|
||||||
|
|
||||||
mixer_ptr make_mixer();
|
mixer_ptr make_mixer();
|
||||||
|
|
||||||
|
mixer_ptr mix(std::vector<stream_ptr> const & streams);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,4 +104,12 @@ namespace psemek::audio
|
||||||
return std::make_shared<mixer_impl>();
|
return std::make_shared<mixer_impl>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mixer_ptr mix(std::vector<stream_ptr> const & streams)
|
||||||
|
{
|
||||||
|
auto mixer = make_mixer();
|
||||||
|
for (auto const & stream : streams)
|
||||||
|
mixer->add(stream);
|
||||||
|
return mixer;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue