public void prepareContext() throws InvalidAudioChannelAssignmentException { new AudioLayoutChecker(contextProvider).checkCorrectChannelLayout(); prepareSoundfieldGroups(); }
@Test public void checkAllResourcesEqualChannelLayout() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext(2, 2, 2, new FFmpegAudioChannels[][]{ {FL, FR}, {FL, FR}, {FL, FR}, {FL, FR}, {FL, FR, FC, LFE, SL, SR}, {FL, FR, FC, LFE, SL, SR}, {FL, FR, FC, LFE, SL, SR}, {FL, FR, FC, LFE, SL, SR} }); new AudioLayoutChecker(contextProvider).checkCorrectChannelLayout(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void checkNoChannelLayout() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext(4, new FFmpegAudioChannels[][]{ }); new AudioLayoutChecker(contextProvider).checkCorrectChannelLayout(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void check_noChannelLayout_forAll() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext(4, new FFmpegAudioChannels[][]{ {FL, FR, FC, LFE, SL, SR} }); new AudioLayoutChecker(contextProvider).checkCorrectChannelLayout(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void checkAllResourcesDifferentChannelLayout() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext(2, 2, 2, new FFmpegAudioChannels[][]{ {FL, FR}, {FL}, {FL, FR}, {FL, FR}, {FL, FR, FC, LFE, SL, SR}, {SL, SR, FC, LFE, FL, FR}, {LFE, SL, SR, FL, FR, FC,}, {FC} }); new AudioLayoutChecker(contextProvider).checkCorrectChannelLayout(); } }
@Test public void checkNoAudio() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext(0, new FFmpegAudioChannels[][]{ }); new AudioLayoutChecker(contextProvider).checkCorrectChannelLayout(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void checkChannelLayoutNotMatchChannelNum() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext(4, 1, 1, new FFmpegAudioChannels[][]{ {FL, FR}, {FL, FR}, {FL, FR}, {FL, FR}, }, new String[]{}, new int[]{1, 1, 1, 1}, new String[]{} ); new AudioLayoutChecker(contextProvider).checkCorrectChannelLayout(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void checkAllResourcesSwappedChannelLayout() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext(2, 2, 2, new FFmpegAudioChannels[][]{ {FL, FR}, {FR, FL}, {FL, FR}, {FL, FR}, {FL, FR, FC, LFE, SL, SR}, {SL, SR, FC, LFE, FL, FR}, {LFE, SL, SR, FL, FR, FC,}, {FC, FR, LFE, SL, SR} }); new AudioLayoutChecker(contextProvider).checkCorrectChannelLayout(); }