Kotlin library to work with EDF files
EDF format description - https://www.teuniz.net/edfbrowser/edf%20format%20description.html
EDF viewer - https://www.teuniz.net/edfbrowser/
data class EdfFile(
val header: EdfHeader, // Header record
val signal: EdfSignal // Data record
) {
val samples: List<Int> = ... // Amount of samples
val sampleRate: List<Double> = ... // Sample rate (second)
}
You can work with File
val file = File("/example.edf")
val edfFile: EdfFile = EdfParser.parse(file)
Or stream
class EdfParserExample
val stream: InputStream = EdfParserExample::class.java.getResourceAsStream("/example.edf")
val edfFile: EdfFile = EdfParser.parse(stream)
Step 1 - Add jitpack repository (https://jitpack.io/)
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
<dependency>
<groupId>com.github.npwork</groupId>
<artifactId>kotlin-edf-parser</artifactId>
<version>0.1.1</version>
</dependency>
implementation 'com.github.npwork:kotlin-edf-parser:0.1.1'