public static TemplateParameterContextProvider createContext(int audioSeqCount, int segmCount, int resourceCount, FFmpegAudioChannels[][] channelsForSeq, String[] soundfieldGroups, String[] langs) throws Exception { return createContext(audioSeqCount, segmCount, resourceCount, channelsForSeq, soundfieldGroups, null, langs); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess16D_two51_noLang() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR, FC, LFE, SL, SR}, {FL, FR, FC, LFE, SL, SR} } ); new AudioMapGuesser(contextProvider, EBU_R_123_16_D).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess16F_threeStereo_sameLang_23() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR}, {FL, FR}, {FL, FR} }, new String[]{"en", "ru", "ru"} ); new AudioMapGuesser(contextProvider, EBU_R_123_16_F).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess16F_threeStereo_sameLang_13() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR}, {FL, FR}, {FL, FR} }, new String[]{"en", "ru", "en"} ); new AudioMapGuesser(contextProvider, EBU_R_123_16_F).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess2A_noStereo() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR, FC, LFE, SL, SR} }); new AudioMapGuesser(contextProvider, EBU_R_48_2_A).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess16D_two51_oneLang() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR, FC, LFE, SL, SR}, {FL, FR, FC, LFE, SL, SR} }, new String[]{"en"} ); new AudioMapGuesser(contextProvider, EBU_R_123_16_D).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess16D_one51() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR, FC, LFE, SL, SR} }, new String[]{"en"} ); new AudioMapGuesser(contextProvider, EBU_R_123_16_D).guessAudioMap(); }
@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(expected = InvalidAudioChannelAssignmentException.class) public void guess4BC_noStereo() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR, FC, LFE, SL, SR} }); new AudioMapGuesser(contextProvider, EBU_R_123_4_B).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess16C_no51() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR}, {FL, FR} }); new AudioMapGuesser(contextProvider, EBU_R_123_16_C).guessAudioMap(); }
@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 guess16C_noStereo() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR, FC, LFE, SL, SR}, {FL, FR, FC, LFE, SL, SR} }); new AudioMapGuesser(contextProvider, EBU_R_123_16_C).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess16D_two51_sameLang() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR, FC, LFE, SL, SR}, {FL, FR, FC, LFE, SL, SR} }, new String[]{"en", "en"} ); new AudioMapGuesser(contextProvider, EBU_R_123_16_D).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess16D_three51() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR, FC, LFE, SL, SR}, {FL, FR, FC, LFE, SL, SR}, {FL, FR, FC, LFE, SL, SR} }, new String[]{"en", "de", "ru"} ); new AudioMapGuesser(contextProvider, EBU_R_123_16_D).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess16F_threeStereo_sameLang_12() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR}, {FL, FR}, {FL, FR} }, new String[]{"en", "en", "ru"} ); new AudioMapGuesser(contextProvider, EBU_R_123_16_F).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess16F_twoStereo_diffLang() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR}, {FL, FR} }, new String[]{"en", "ru"} ); new AudioMapGuesser(contextProvider, EBU_R_123_16_F).guessAudioMap(); }
@Test(expected = InvalidAudioChannelAssignmentException.class) public void guess16F_fourStereo_diffLang() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ {FL, FR}, {FL, FR}, {FL, FR}, {FL, FR} }, new String[]{"en", "ru", "de", "it"} ); new AudioMapGuesser(contextProvider, EBU_R_123_16_F).guessAudioMap(); }
@Test public void check_noAudio() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext(0, new FFmpegAudioChannels[][]{ }); AudioMapType audioMap = new AudioMapGuesser(contextProvider, EBU_R_123_16_C).guessAudioMap(); assertNull(audioMap); }
@Test(expected = RuntimeException.class) public void testUnknownLayout() throws Exception { TemplateParameterContextProvider contextProvider = AudioUtils.createContext( new FFmpegAudioChannels[][]{ }); ChannelsMapper mapper = new ChannelsMapper(contextProvider); mapper.mapChannels(createLayoutOptions(new LayoutType[]{null}, new String[]{"en"})); }