本文整理汇总了C#中IAudioService类的典型用法代码示例。如果您正苦于以下问题:C# IAudioService类的具体用法?C# IAudioService怎么用?C# IAudioService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IAudioService类属于命名空间,在下文中一共展示了IAudioService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetParser
public static Parser<DoNotAwaitAction> GetParser(
int indentLevel,
IAudioService audioService,
IDelayService delayService,
ILoggerService loggerService,
ISpeechService speechService)
{
if (indentLevel < 0)
{
throw new ArgumentException("indentLevel must be greater than or equal to 0.", "indentLevel");
}
audioService.AssertNotNull(nameof(audioService));
delayService.AssertNotNull(nameof(delayService));
loggerService.AssertNotNull(nameof(loggerService));
speechService.AssertNotNull(nameof(speechService));
return
from _ in Parse.IgnoreCase("don't")
from __ in HorizontalWhitespaceParser.Parser.AtLeastOnce()
from ___ in Parse.IgnoreCase("wait:")
from ____ in VerticalSeparationParser.Parser.AtLeastOnce()
from actions in ActionListParser.GetParser(indentLevel + 1, audioService, delayService, loggerService, speechService)
let child = new SequenceAction(actions)
select new DoNotAwaitAction(
loggerService,
child);
}
示例2: QuestionViewModel
public QuestionViewModel(IQuestionService questionService,
INavigationService navigationService,
IBadgeService badgeService,
ISettingsService settingsService,
ILocalizationService localizationService,
IAudioService audioService)
{
_questionService = questionService;
_navigationService = navigationService;
_badgeService = badgeService;
_settingsService = settingsService;
_localizationService = localizationService;
_audioService = audioService;
Messenger.Default.Register<Set>(this, Load);
Messenger.Default.Register<CleanUp>(this, CallCleanUp);
#if DEBUG
if (IsInDesignMode)
{
SelectedQuestion = new Question();
BindQuestion(SelectedQuestion);
ProgresLabel = "1/10";
CorrectAnswers = 0;
IncorrectAnswers = 0;
}
#endif
}
示例3: Pong
public Pong()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
audioService = new AudioService();
Services.AddService(typeof(IAudioService), audioService);
}
示例4: GameController
public GameController(
Game game,
ICollisionDetectionService collisionDetectionService,
IPlayerService playerService,
IEnemyService enemyService,
IInputService inputService,
IHeadUpDisplayService headUpDisplayService,
ITerrainService terrainService,
IAudioService audioService)
: base(game)
{
this.game = game;
this.collisionDetectionService = collisionDetectionService;
this.playerService = playerService;
this.enemyService = enemyService;
this.inputService = inputService;
this.headUpDisplayService = headUpDisplayService;
this.terrainService = terrainService;
this.audioService = audioService;
this.inputService.AnalogPauseChanged += delegate { this.isGamePaused = !this.isGamePaused; };
this.inputService.PauseChanged += delegate { this.isGamePaused = !this.isGamePaused; };
this.fadeEffect = "FadeIn";
}
示例5: MainViewModel
public MainViewModel(
IAudioService audioService,
ICalibrationService calibrationService,
IDictionaryService dictionaryService,
IKeyStateService keyStateService,
ISuggestionStateService suggestionService,
ICapturingStateManager capturingStateManager,
ILastMouseActionStateManager lastMouseActionStateManager,
IInputService inputService,
IKeyboardOutputService keyboardOutputService,
IMouseOutputService mouseOutputService,
IWindowManipulationService mainWindowManipulationService,
List<INotifyErrors> errorNotifyingServices)
{
this.audioService = audioService;
this.calibrationService = calibrationService;
this.dictionaryService = dictionaryService;
this.keyStateService = keyStateService;
this.suggestionService = suggestionService;
this.capturingStateManager = capturingStateManager;
this.lastMouseActionStateManager = lastMouseActionStateManager;
this.inputService = inputService;
this.keyboardOutputService = keyboardOutputService;
this.mouseOutputService = mouseOutputService;
this.mainWindowManipulationService = mainWindowManipulationService;
this.errorNotifyingServices = errorNotifyingServices;
calibrateRequest = new InteractionRequest<NotificationWithCalibrationResult>();
SelectionMode = SelectionModes.Key;
InitialiseKeyboard(mainWindowManipulationService);
AttachScratchpadEnabledListener();
AttachKeyboardSupportsCollapsedDockListener(mainWindowManipulationService);
AttachKeyboardSupportsSimulateKeyStrokesListener();
}
示例6: DuplicatesDetectorService
public DuplicatesDetectorService(IModelService modelService, IAudioService audioService, IFingerprintCommandBuilder fingerprintCommandBuilder, IQueryFingerprintService queryFingerprintService)
{
this.modelService = modelService;
this.audioService = audioService;
this.fingerprintCommandBuilder = fingerprintCommandBuilder;
this.queryFingerprintService = queryFingerprintService;
}
示例7: GetParser
public static Parser<IAction> GetParser(
int indentLevel,
IAudioService audioService,
IDelayService delayService,
ILoggerService loggerService,
ISpeechService speechService)
{
if (indentLevel < 0)
{
throw new ArgumentException("indentLevel must be greater than or equal to 0.", "indentLevel");
}
audioService.AssertNotNull(nameof(audioService));
delayService.AssertNotNull(nameof(delayService));
loggerService.AssertNotNull(nameof(loggerService));
speechService.AssertNotNull(nameof(speechService));
return BreakActionParser.GetParser(delayService, speechService)
.Or<IAction>(MetronomeActionParser.GetParser(audioService, delayService, loggerService))
.Or<IAction>(PrepareActionParser.GetParser(delayService, speechService))
.Or<IAction>(SayActionParser.GetParser(speechService))
.Or<IAction>(WaitActionParser.GetParser(delayService))
.Or<IAction>(DoNotAwaitActionParser.GetParser(indentLevel, audioService, delayService, loggerService, speechService))
.Or<IAction>(ParallelActionParser.GetParser(indentLevel, audioService, delayService, loggerService, speechService))
.Or<IAction>(SequenceActionParser.GetParser(indentLevel, audioService, delayService, loggerService, speechService));
}
示例8: MainWindow
public MainWindow(
IAudioService audioService,
IDictionaryService dictionaryService,
IInputService inputService)
{
InitializeComponent();
this.audioService = audioService;
this.dictionaryService = dictionaryService;
this.inputService = inputService;
managementWindowRequest = new InteractionRequest<NotificationWithServices>();
//Setup key binding (Alt-C and Shift-Alt-C) to open settings
InputBindings.Add(new KeyBinding
{
Command = new DelegateCommand(RequestManagementWindow),
Modifiers = ModifierKeys.Alt,
Key = Key.M
});
InputBindings.Add(new KeyBinding
{
Command = new DelegateCommand(RequestManagementWindow),
Modifiers = ModifierKeys.Shift | ModifierKeys.Alt,
Key = Key.M
});
Title = string.Format(Properties.Resources.WINDOW_TITLE, DiagnosticInfo.AssemblyVersion);
}
示例9: connect
public void connect(String url, IAudioServiceCallBack callback, EventHandler openedEvt = null, EventHandler faultEvt = null) //url = "net.tcp://localhost:8080/AudioService"
{
try
{
duplex = new DuplexChannelFactory<IAudioService>(callback, new NetTcpBinding(),
new EndpointAddress(url));
service = duplex.CreateChannel();
channel = (ICommunicationObject)service;
IClientChannel c = (IClientChannel)channel;
c.OperationTimeout = TimeSpan.FromSeconds(5);
channel.Opened += new EventHandler(delegate(object o, EventArgs e)
{
Console.WriteLine("Connection ok!");
});
if(openedEvt != null)
channel.Opened += openedEvt;
if(faultEvt != null)
channel.Faulted += faultEvt;
channel.Faulted += new EventHandler(delegate(object o, EventArgs e)
{
Console.WriteLine("Connection lost");
});
}
catch (Exception e)
{
Console.WriteLine("Connection error: " + e.Message);
}
}
示例10: EventSettingItem
public EventSettingItem(EventSettingsViewModel eventSettingsViewModel, EventSetting eventSetting, IAudioService audioService, ISettingsService settingsService)
{
this.eventSettingsViewModel = eventSettingsViewModel;
EventSetting = eventSetting;
this.audioService = audioService;
this.settingsService = settingsService;
}
示例11: GetTrackSamples
/// <summary>
/// Get track samples
/// </summary>
/// <param name = "track">Track from which to gather samples</param>
/// <param name = "proxy">Proxy used in gathering samples</param>
/// <param name = "sampleRate">Sample rate used in gathering samples</param>
/// <param name = "milliseconds">Milliseconds to gather</param>
/// <param name = "startmilliseconds">Starting millisecond</param>
/// <returns></returns>
public static float[] GetTrackSamples(Track track, IAudioService proxy, int sampleRate, int milliseconds, int startmilliseconds)
{
if (track == null || track.Path == null)
return null;
//read 5512 Hz, Mono, PCM, with a specific audioService
return proxy.ReadMonoFromFile(track.Path, sampleRate, milliseconds, startmilliseconds);
}
示例12: WinMisc
public WinMisc(IFingerprintCommandBuilder fingerprintCommandBuilder, IAudioService audioService)
{
this.fingerprintCommandBuilder = fingerprintCommandBuilder;
this.audioService = audioService;
InitializeComponent();
Icon = Resources.Sound;
}
示例13: UsingServices
public IQueryCommand UsingServices(IModelService modelService, IAudioService audioService)
{
this.modelService = modelService;
createFingerprintMethod = () => fingerprintingMethodFromSelector()
.WithFingerprintConfig(FingerprintConfiguration)
.UsingServices(audioService);
return this;
}
示例14: AudioAction
public AudioAction(IAudioService audioService, string audioName)
{
Ensure.ArgumentNotNull(audioService, nameof(audioService));
Ensure.ArgumentNotNull(audioName, nameof(audioName));
this.audioService = audioService;
this.audioName = audioName;
}
示例15: AudioAction
public AudioAction(IAudioService audioService, string audioName)
{
audioService.AssertNotNull(nameof(audioService));
audioName.AssertNotNull(nameof(audioName));
this.audioService = audioService;
this.audioName = audioName;
}