-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathAudioInputBase.cs
More file actions
36 lines (32 loc) · 1.21 KB
/
AudioInputBase.cs
File metadata and controls
36 lines (32 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) TensorStack. All rights reserved.
// Licensed under the Apache 2.0 License.
using System.Threading;
using System.Threading.Tasks;
using TensorStack.Common.Tensor;
namespace TensorStack.Audio
{
public abstract class AudioInputBase : AudioTensor
{
/// <summary>
/// Initializes a new instance of the <see cref="AudioInputBase"/> class.
/// </summary>
/// <param name="audioTensor">The audio tensor.</param>
protected AudioInputBase(AudioTensor audioTensor)
: base(audioTensor, audioTensor.SampleRate) { }
/// <summary>
/// Gets the source audio filename.
/// </summary>
public abstract string SourceFile { get; }
/// <summary>
/// Save the Audio to file
/// </summary>
/// <param name="filename">The filename.</param>
public abstract void Save(string filename);
/// <summary>
/// Save the Audio to file
/// </summary>
/// <param name="filename">The filename.</param>
/// <param name="cancellationToken">The cancellation token</param>
public abstract Task SaveAsync(string filename, CancellationToken cancellationToken = default);
}
}